shuffled<
T>(random,values): readonlyT[]
Defined in: packages/sampling/src/shuffle.ts:12
Return a uniformly shuffled copy of values using Fisher-Yates.
Runs in O(values.length) time and uses O(values.length) space for the copy. The input is never mutated.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”random
Section titled “random”values
Section titled “values”readonly T[]
Returns
Section titled “Returns”readonly T[]
Throws
Section titled “Throws”With code INVALID_SOURCE_VALUE when the
random source returns a value outside [0, 1).