洗牌—随机打乱数组的方法

const items = [1, 2, 3, 4, 5];

items.sort(() => (0.5 - Math.random()));
原文地址:https://www.cnblogs.com/maogu2/p/14454015.html