Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

picker

import { picker } from "https://git.sr.ht/~ruivieira/deno-experiments/blob/master/randomjs/mod.ts";

Returns a Distribution to random value within the provided source within the sliced bounds of begin and end.

function picker<T>(
source: ArrayLike<T>,
begin?: number,
end?: number,
): Distribution<T>;
§
picker<T>(source: ArrayLike<T>, begin?: number, end?: number): Distribution<T>
[src]

§Type Parameters

§Parameters

§
source: ArrayLike<T>
[src]

an array of items to pick from

§
begin?: number optional
[src]

the beginning slice index (defaults to 0)

§
end?: number optional
[src]

the ending slice index (defaults to source.length)

§Return Type