Create a new array with the items randomized (does not mutate the original array).
Returns a new array with the items randomized.
array
Type: Array
The array to shuffle.
options
Type: object
randomNumberGenerator
Type: () => number
Custom random number generator that returns a float between 0 (inclusive) and 1 (exclusive). This is useful for deterministic shuffling when you use a seeded generator.
Randomize the order of items in an array, mutating the array in-place.
Returns the input array shuffled.
array
Type: Array
The array to shuffle.
options
Type: object
randomNumberGenerator
Type: () => number
Custom random number generator that returns a float between 0 (inclusive) and 1 (exclusive). This is useful for deterministic shuffling when you use a seeded generator.