Skip to content

shuffleInPlace

shuffleInPlace<T>(items): T[]

Defined in: src/global/collections.ts:160

Fisher–Yates in place: the only mutating shuffle.

T

T[]

T[]

const deck = [1, 2, 3, 4, 5];
shuffleInPlace(deck); // deck itself is reordered and returned