Skip to content

shuffled<T>(random, values): readonly T[]

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.

T

RandomSource

readonly T[]

readonly T[]

With code INVALID_SOURCE_VALUE when the random source returns a value outside [0, 1).