Gitiles
Code Review
Sign In
source.supwisdom.com
/
dali_platform
/
mobile
/
1bc4ccca59157cb73d9d8e9c058e6401c21a7f61
/
.
/
uview-ui
/
libs
/
function
/
randomArray.js
blob: 590a048036778fa3e3b53851c95a3b8d19c8ea05 [
file
] [
log
] [
blame
]
// 打乱数组
function
randomArray
(
array
=
[])
{
// 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
return
array
.
sort
(()
=>
Math
.
random
()
-
0.5
);
}
export
default
randomArray