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(array) { | |
var unshuffled = array.length, | |
copy, | |
remaining; | |
// While there are unshuffled elements | |
while (unshuffled) { | |
// Get one that hasn't been replaced yet | |
remaining = Math.floor(Math.random() * unshuffled--); | |
// And replace it with the unshuffled element |
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
p 40 |