回答編集履歴
1
テキスト修正
test
CHANGED
@@ -12,17 +12,21 @@
|
|
12
12
|
|
13
13
|
var arr2 = arr.reduce(
|
14
14
|
|
15
|
-
(a, e) =>
|
15
|
+
(a, e, i) => i % 4 ?
|
16
16
|
|
17
|
-
|
17
|
+
[...a.slice(0, a.length-1), [...a[a.length-1], e] ]
|
18
18
|
|
19
|
+
:
|
20
|
+
|
21
|
+
[...a, [e]]
|
22
|
+
|
19
|
-
,[
|
23
|
+
,[]
|
20
24
|
|
21
25
|
)
|
22
26
|
|
23
27
|
```
|
24
28
|
|
25
|
-
- 動作確認用 CodePen: [https://codepen.io/jun68ykt/pen/
|
29
|
+
- 動作確認用 CodePen: [https://codepen.io/jun68ykt/pen/dyPNpEM?editors=0012](https://codepen.io/jun68ykt/pen/dyPNpEM?editors=0012)
|
26
30
|
|
27
31
|
|
28
32
|
|