Skip to content

Instantly share code, notes, and snippets.

@singuerinc
Created September 16, 2013 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save singuerinc/6581326 to your computer and use it in GitHub Desktop.
Save singuerinc/6581326 to your computer and use it in GitHub Desktop.
shuffle array
function shuffle(o){
for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
return o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment