Skip to content

Commit

Permalink
docs(collections): add module example (#4475)
Browse files Browse the repository at this point in the history
docs(collections): add module docs
  • Loading branch information
iuioiua authored Mar 12, 2024
1 parent 57605ec commit 48d7fd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion collections/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
8 changes: 8 additions & 0 deletions collections/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

Expand Down

0 comments on commit 48d7fd5

Please sign in to comment.