There are faster ways of shuffling array elements, but this is nice and short:
Code:Array.prototype.shuffle=function(){ return this.sort(function(){return [-1,1][Math.floor(Math.random()*2)]}) }
|
|
Results 1 to 15 of 221
Threaded View
Thread InformationUsers Browsing this ThreadThere are currently 3 users browsing this thread. (0 members and 3 guests) |
|
Bookmarks