// 数组重排序 const shuffle = (arr) => { return arr.sort(() => { return Math.random() - 0.5 }) } const arr = [1, 2, 3, 4, 5] console.log(shuffle(arr)) const isDarkMode = () => window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches; console.log(isDarkMode())