function shuffle(arr){
var len = arr.length;
for(var i = 0; i < len - 1; i++){
var idx = Math.floor(Math.random() * (len - i));
var temp = arr[idx];
arr[idx] = arr[len - i - 1];
arr[len - i -1] = temp;
}
return arr;
}
标签:arr,temp,idx,len,随机,数组,var,排序,Math From: https://www.cnblogs.com/bkyjmjweb/p/16732325.html