SOURCE

const shuffe = (arr) => {
    for(let i = arr.length-1;i>=0;i--){
        const rIndex = Math.floor(Math.random()*(i+1))
        const rItem = arr[rIndex];

        arr[rIndex] = arr[i];
        arr[i] = rItem;
    }

    return arr
}

const arr = [1,53,2,5,6,2,4]

console.log(shuffe(arr))
console 命令行工具 X clear

                    
>
console