Skip to content

Instantly share code, notes, and snippets.

@zoxon
Forked from d-simon/shuffle_array.js
Created December 22, 2016 03:01
Show Gist options
  • Save zoxon/f17624e2ed57ba3fc5a794f298de8bcf to your computer and use it in GitHub Desktop.
Save zoxon/f17624e2ed57ba3fc5a794f298de8bcf 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