Created
May 24, 2017 15:35
-
-
Save beatak/1723c3a1c7feeb729dd2349f1d36a345 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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