forked from M3-Academy/challenge-algorithms-v2.0
fix(maxvalue)terminando
This commit is contained in:
parent
e0fd9b8e4a
commit
a561a42a38
@ -1,8 +1,7 @@
|
||||
export function maxValue(values) {
|
||||
var arr = values;
|
||||
|
||||
const arr = values;
|
||||
if (arr.length == 0) return 0;
|
||||
var max1 = arr.reduce(function (a, b) {
|
||||
const max1 = arr.reduce(function (a, b) {
|
||||
return Math.max(a, b);
|
||||
}, -Infinity);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user