Skip to content

shuffle

shuffle(array)

Returns a new array with the elements of array randomly shuffled.

ts
shuffle([1, 2, 3, 4]); // [3, 1, 4, 2] (random)
ts
pipe([1, 2, 3, 4], shuffle()); // [3, 1, 4, 2] (random)