Last active
January 5, 2018 12:55
-
-
Save faridlab/27bcd04bef4a51796f6b666d9c6ad370 to your computer and use it in GitHub Desktop.
Javascript Shuffle Array
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 shuffle = array.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