function getRandomInt(min,max){
  return Math.floor(Math.random()*(max-min+1) +min)
}
export function shuffle(arr){
let _arr = arr.slice()
for(let i=0;i<_arr.length;i++){ let j=getRandomInt(0,i) let t = _arr[i] _arr[i] = _arr[j] _arr[j] =t } return _arr }

 

posted on 2021-01-09 15:33  白不了的黑发  阅读(184)  评论(0编辑  收藏  举报