Shuffles the positions of an array's entries (without mutating the array).
Pass a SeededRandom instance to get the same order every time from the same seed. Without one, this uses cryptographically secure randomness.
Optional
A new array (does not mutate).
import {SeededRandom, shuffleArray} from '@augment-vir/common';shuffleArray([ 1, 2, 3,]); // a different order each timeshuffleArray( [ 1, 2, 3, ], SeededRandom.fromSeed('hello there'),); // always the same order Copy
import {SeededRandom, shuffleArray} from '@augment-vir/common';shuffleArray([ 1, 2, 3,]); // a different order each timeshuffleArray( [ 1, 2, 3, ], SeededRandom.fromSeed('hello there'),); // always the same order
@augment-vir/common
Shuffles the positions of an array's entries (without mutating the array).
Pass a SeededRandom instance to get the same order every time from the same seed. Without one, this uses cryptographically secure randomness.