Skip to content

Instantly share code, notes, and snippets.

@d-simon
Created March 7, 2014 13:04
Show Gist options
  • Save d-simon/9411089 to your computer and use it in GitHub Desktop.
Save d-simon/9411089 to your computer and use it in GitHub Desktop.
Shuffle Array
shuffle = function(v){
for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
return v;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment