Created
September 2, 2017 22:13
-
-
Save akella/8eb84efc67a6835e742ffc83e3a6034b to your computer and use it in GitHub Desktop.
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
function shuffle(a) { | |
for (let i = a.length; i; i--) { | |
let j = Math.floor(Math.random() * i); | |
[a[i - 1], a[j]] = [a[j], a[i - 1]]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment