Home > @infiniteobjects/core-library-web > Random > sample
From the population
array, produce an array with sampleSize
elements that are randomly chosen without repeats.
Signature:
static sample<T>(population: ArrayLike<T>, sampleSize: number): T[];
Parameter | Type | Description |
---|---|---|
population | ArrayLike<T> | |
sampleSize | number |
Returns:
T[]