The array to shuffle.
A new array with the same elements in random order.
shuffleArray([1, 2, 3, 4, 5]); // Returns: [3, 1, 5, 2, 4] (random order)
shuffleArray(['a', 'b', 'c']); // Returns: ['c', 'a', 'b'] (random order)
shuffleArray([]); // Returns: []
Generated using TypeDoc
Randomizes the order of elements in an array using the Fisher-Yates shuffle algorithm.