回答編集履歴

1

破壊的なコード

2016/06/22 10:35

投稿

think49
think49

スコア18166

test CHANGED
@@ -76,4 +76,20 @@
76
76
 
77
77
 
78
78
 
79
+ 変数を分けて `Array#reduce` を使っている事から `attendance` と `attendance_and_vehicle` で依存関係がないように書いていますが、破壊的で良いのなら `attendance` を直接書き換える手法がより効率的です。
80
+
81
+
82
+
83
+ ```JavaScript
84
+
85
+ Object.keys(attendance).forEach(function (key) {
86
+
87
+ // attendance[key] を書き換える
88
+
89
+ });
90
+
91
+ ```
92
+
93
+
94
+
79
95
  Re: snakeriver さん