Skip to content

Instantly share code, notes, and snippets.

@dfadler
Created May 2, 2012 20:13
Show Gist options
  • Save dfadler/2580039 to your computer and use it in GitHub Desktop.
Save dfadler/2580039 to your computer and use it in GitHub Desktop.
Javascript Array Shuffle
// Thanks dude http://css-tricks.com/snippets/javascript/shuffle-array/
function shuffle(o) {
for(var j, x, i = o.length; i; j = parseInt(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