This commit is contained in:
2026-10-08 18:19:39 +08:00
parent 25b8d0104f
commit 75527ae81d
425 changed files with 53925 additions and 2645 deletions
@@ -0,0 +1,7 @@
// 打乱数组
function randomArray(array = []) {
// 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
return array.sort(() => Math.random() - 0.5);
}
export default randomArray