Skip to content

Instantly share code, notes, and snippets.

@motoishmz
Last active October 19, 2020 08:18
Show Gist options
  • Save motoishmz/5239619 to your computer and use it in GitHub Desktop.
Save motoishmz/5239619 to your computer and use it in GitHub Desktop.
Array.prototype.shuffle = function()
{
var i = this.length;
while (i)
{
var j = Math.floor(Math.random() * i);
var t = this[--i];
this[i] = this[j];
this[j] = t;
}
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment