mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
docs(collections): add module example (#4475)
docs(collections): add module docs
This commit is contained in:
parent
57605ecc0e
commit
48d7fd5b01
@ -28,6 +28,6 @@ export function filterInPlace<T>(
|
||||
/**
|
||||
* Produces a random number between the inclusive `lower` and `upper` bounds.
|
||||
*/
|
||||
export function randomInteger(lower: number, upper: number) {
|
||||
export function randomInteger(lower: number, upper: number): number {
|
||||
return lower + Math.floor(Math.random() * (upper - lower + 1));
|
||||
}
|
||||
|
@ -9,6 +9,14 @@
|
||||
* {@link https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/ | Kotlin's Collections}
|
||||
* package.
|
||||
*
|
||||
* ```ts
|
||||
* import { intersect } from "https://deno.land/std@$STD_VERSION/collections/intersect.ts";
|
||||
*
|
||||
* const lisaInterests = ["Cooking", "Music", "Hiking"];
|
||||
* const kimInterests = ["Music", "Tennis", "Cooking"];
|
||||
* intersect(lisaInterests, kimInterests); // [ "Cooking", "Music" ]
|
||||
* ```
|
||||
*
|
||||
* @module
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user