JS数组的洗牌方法

 

 

const shuffleArray = arr => arr.sort(() => Math.random() - 0.5);

 

posted @ 2022-03-14 18:19  樊顺  阅读(52)  评论(0编辑  收藏  举报