标签:
var shuffleArray = function(array) {
var currentIndex = array.length;
var temporary;
var toIndex;
while (currentIndex) {
toIndex = Math.floor(Math.random() * currentIndex--);
temporary = array[currentIndex];
array[currentIndex] = array[toIndex];
array[toIndex] = temporary;
}
return array;
}
标签:
原文地址:http://www.cnblogs.com/andyjin/p/5916291.html