function Daluan(arr) {
var tmpArray = arr.slice(0);
console.log(tmpArray);
var result = [];
while (tmpArray.length >= 1) {
var randomIndex = Math.floor(Math.random() * tmpArray.length);
var value = tmpArray[randomIndex];
result.push(value);
tmpArray.splice(randomIndex, 1);
}
return result;
}
网友评论