Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
function shuffle(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
return array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment