数组打乱顺序

let arr = ['生','日','快','乐','666']
var randomNumber = function(){
return 0.5 - Math.random()
}
arr.sort(randomNumber)
console.log(arr)

posted @ 2022-01-17 08:53  wangnima666  阅读(66)  评论(0编辑  收藏  举报