📅  最后修改于: 2022-03-11 15:02:29.485000             🧑  作者: Mango
const shuffleArray = (arr) => arr.sort(() => 0.5 - Math.random());
console.log(shuffleArray([1, 2, 3, 4]));
// Result: [ 1, 4, 3, 2 ]