Skip to content

Commit 03dc5e5

Browse files
authored
例外処理修正 (2)
1 parent 3fb46c9 commit 03dc5e5

File tree

1 file changed

+1
-1
lines changed
  • docs/1-trial-session/10-array/_samples/array-max-reduce

1 file changed

+1
-1
lines changed

docs/1-trial-session/10-array/_samples/array-max-reduce/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function max(a, b) {
33
}
44

55
function arrayMax(array) {
6-
if (array == []) return; //空配列をエスケープ
6+
if (array.length == 0) return; //空配列の例外処理
77
return array.reduce(max, array[0]);
88
}
99

0 commit comments

Comments
 (0)