We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f666df4 commit b51939cCopy full SHA for b51939c
Sprint-1/implement/max.js
@@ -5,11 +5,13 @@ function findMax(elements) {
5
6
// If there are no numeric values, return infinity
7
if (numericElements.length === 0) {
8
- return Infinity;
+ return -Infinity;
9
}
10
11
// use Math.max with spread (...) to get the maximum number
12
return Math.max(...numericElements);
13
+
14
15
16
17
module.exports = findMax;
0 commit comments