Skip to content

Instantly share code, notes, and snippets.

@beatak
Created May 24, 2017 15:35
Show Gist options
  • Save beatak/1723c3a1c7feeb729dd2349f1d36a345 to your computer and use it in GitHub Desktop.
Save beatak/1723c3a1c7feeb729dd2349f1d36a345 to your computer and use it in GitHub Desktop.
Array.prototype.shuffle = function () {
var m = this.length, t, i;
while (m) {
i = Math.floor(Math.random() * m--);
t = this[m];
this[m] = this[i];
this[i] = t;
}
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment