![]() |
VOOZH | about |
Lodash _.shuffle() method creates an array of shuffled values from the given collection using a version of the Fisher-Yates shuffle algorithm.
_.shuffle(collection);This method is used to return the new shuffled array.
Example 1: In this example, we are shuffling an array by the use of the _.shuffle() method.
Output:
[ 10, 9, 4, 2, 6 ]Example 2: In this example, we are shuffling an array by the use of the _.shuffle() method.
Output:
[ 'sat', 'wed', 'fri', 'sun', 'thu', 'mon', 'tue']