stack

Home > @infiniteobjects/core-library-web > Random > sample

Random.sample() method

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[];

Parameters

Parameter Type Description
population ArrayLike<T>  
sampleSize number  

Returns:

T[]