let arr=[2,5,1,3,8]
arr.sort(()=>Math.random()-0.5)
//[5,2,3,1,8]
//[3,1,8,5,2]
如何随机打乱数组的元素
おすすめ
転載: blog.csdn.net/weixin_47389477/article/details/117998574
おすすめ
ランキング