This file contains 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
/* | |
* Add a shuffle function to Array object prototype | |
* Usage : | |
* var tmpArray = ["a", "b", "c", "d", "e"]; | |
* tmpArray.shuffle(); | |
*/ | |
Array.prototype.shuffle = function (){ | |
var i = this.length, j, temp; | |
if ( i == 0 ) return; | |
while ( --i ) { |