回答編集履歴
1
1
answer
CHANGED
@@ -6,16 +6,16 @@
|
|
6
6
|
|
7
7
|
const p = data.indexOf(item);
|
8
8
|
if (p == -1) return [];
|
9
|
-
|
9
|
+
const [x1] = data.splice(p,1)
|
10
10
|
ret.push(x1);
|
11
11
|
|
12
|
-
|
12
|
+
const [x2] = data.splice(Math.floor(Math.random() * data.length),1);
|
13
13
|
ret.push(x2);
|
14
14
|
|
15
|
-
|
15
|
+
const [x3] = data.splice(Math.floor(Math.random() * data.length),1);
|
16
16
|
ret.push(x3);
|
17
17
|
|
18
|
-
|
18
|
+
const [x4] = data.splice(Math.floor(Math.random() * data.length),1);
|
19
19
|
ret.push(x4);
|
20
20
|
|
21
21
|
for (let i = ret.length - 1; i >= 0; i--) {
|