回答編集履歴
1
関数の追加
answer
CHANGED
@@ -25,5 +25,15 @@
|
|
25
25
|
// })
|
26
26
|
// }
|
27
27
|
|
28
|
+
//reduceを使った場合
|
29
|
+
// const candleArr = Arr.reduce((acc, bitcoinRateList) => {
|
30
|
+
// return acc.push({
|
31
|
+
// Open: bitcoinRateList[29],
|
32
|
+
// Close: bitcoinRateList[0],
|
33
|
+
// High: Math.max.apply(null, bitcoinRateList),
|
34
|
+
// Low: Math.min.apply(null, bitcoinRateList),
|
35
|
+
// }) && acc// acc.pushだけだとacc配列内の値の個数が返ってきてしまうため、&&することでpush後のarrを返すことに成功している。
|
36
|
+
// }, []);
|
37
|
+
|
28
38
|
console.log(candleArr)
|
29
39
|
```
|