Loading problem…
Implement a shuffle function that randomly rearranges the elements of an array in place.
shuffle
const arr = [1, 2, 3, 4, 5]; shuffle(arr); // arr is now randomly shuffled, e.g., [3, 1, 5, 2, 4] // Returns the same array reference
3 hints available with Pro
No related problems available yet.