Open EgizianoEG opened 12 months ago
shuffle
does not manipulate the original array. Instead the changes are made to a new one that is returned. Your code will work if you make this change:
for (let i = 0; i < 1_000_000; i++) {
let array = [1, 2, 3];
array = shuffle(array);
count[array.join("")]++;
}
The 'shuffle' function has a bug when it fails to return an array that is shuffled. The same incorrect behavior is occurring on the documentation object as well.
Reproducible code: