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

sample

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

From the population array, produce an array with sampleSize elements that are randomly chosen without repeats.

function sample<T>(
engine: Engine,
population: ArrayLike<T>,
sampleSize: number,
): T[];
§
sample<T>(engine: Engine, population: ArrayLike<T>, sampleSize: number): T[]
[src]

§Type Parameters

§Parameters

§
engine: Engine
[src]

The Engine to use when choosing random values

§
population: ArrayLike<T>
[src]

An array that has items to choose a sample from

§
sampleSize: number
[src]

The size of the result array

§Return Type