标签:[] cti splice return shuf random new 数组 dom
function insertArr(arr,newarr){
var num=parseInt(Math.random()*arr.length);
newarr.push(arr.splice(num,1)[0]);
if(arr.length==0){
return newarr;
} else {
return insertArr(arr,newarr);
}
}
insertArr([1,2,3,4,5,6],[]);
标签:[] cti splice return shuf random new 数组 dom
原文地址:http://www.cnblogs.com/TonyLearning/p/7067619.html