UNPKG
node-mirai-fgo-gacha
Version:
latest (0.0.9)
0.0.9
0.0.8
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
node-mirai-sdk fgo gacha plugin
node-mirai-fgo-gacha
/
src
/
shuffle.js
10 lines
(8 loc)
•
201 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
shuffle
= a => {
for
(
let
i = a.
length
-
1
; i >
0
; i --) {
const
j =
Math
.
floor
(
Math
.
random
() * (i +
1
)); [a[i], a[j]] = [a[j], a[i]]; }
return
a; };
module
.
exports
= shuffle;