回答編集履歴

1

関数の追加

2018/03/30 17:29

投稿

fjaiofjawiefjaw
fjaiofjawiefjaw

スコア210

test CHANGED
@@ -52,6 +52,26 @@
52
52
 
53
53
 
54
54
 
55
+ //reduceを使った場合
56
+
57
+ // const candleArr = Arr.reduce((acc, bitcoinRateList) => {
58
+
59
+ // return acc.push({
60
+
61
+ // Open: bitcoinRateList[29],
62
+
63
+ // Close: bitcoinRateList[0],
64
+
65
+ // High: Math.max.apply(null, bitcoinRateList),
66
+
67
+ // Low: Math.min.apply(null, bitcoinRateList),
68
+
69
+ // }) && acc// acc.pushだけだとacc配列内の値の個数が返ってきてしまうため、&&することでpush後のarrを返すことに成功している。
70
+
71
+ // }, []);
72
+
73
+
74
+
55
75
  console.log(candleArr)
56
76
 
57
77
  ```