- // (C) Stephen "felgall" <a href="http://www.codingforums.com/showthread.php?t=252059">http://www.codingforums.com/showthread.php?t=252059
- Array.prototype.shuffle = function() {
- var s = [];
- while (this.length) s.push(this.splice(Math.random() * this.length, 1));
- while (s.length) this.push(s.pop());
- return this;
- }
- //该片段来自于http://www.codesnippet.cn/detail/080120131413.html
来源: http://www.codesnippet.cn/detail/080120131413.html