📜  arry suffle javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:36.557000             🧑  作者: Mango

代码示例1
const shuffle = a => {
    for (let i = a.length; i; i--) {
        let j = Math.floor(Math.random() * i);
        [a[i - 1], a[j]] = [a[j], a[i - 1]];
    }
}
shuffle(arry);