回答編集履歴
1
情報の追加。
test
CHANGED
@@ -9,3 +9,23 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
【MDN】[Array.prototype.fill()](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/fill), [Array.prototype.map()](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/map), [Array.prototype.reduce()](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce), [Array.prototype.push()](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/push)
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
---
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
**追記:**
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
もう少し短くなるかと思ったがそうでもなかった。
|
24
|
+
|
25
|
+
```js
|
26
|
+
|
27
|
+
const arr = new Array( 24 ).fill( null ).reduce( ( s, c, i )=> ( c = ( '0' + i ).slice( -2 ), s + `${c}:00,${c}:30,` ), '' ).split( ',', 48 );
|
28
|
+
|
29
|
+
console.log( arr );
|
30
|
+
|
31
|
+
```
|