Last active
February 17, 2019 01:43
-
-
Save nandomoreirame/24b609acabf26acd358acf42fd6718df to your computer and use it in GitHub Desktop.
shuffle-array.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const shuffleArray = (arr) => | |
| arr.map(a => [Math.random(), a]).sort((a, b) => a[0] - b[0]).map(a => a[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment