实现一
function shuffle1(arr){
const result = [];
let random = 0;
while(arr.length > 0){
random = Math.floor(Math.random() * arr.length);
result.push(arr[random]);
arr.splice(random,1);
}
return result
}
function shuffle1(arr){
const result = [];
let random = 0;
while(arr.length > 0){
random = Math.floor(Math.random() * arr.length);
result.push(arr[random]);
arr.splice(random,1);
}
return result
}
留言