challenge-algorithms-v2.0-c.../03-maxValue/index.js
2022-10-28 07:35:13 -04:00

12 lines
232 B
JavaScript

export function maxValue(values) {
// implementar logica aqui
if (values != `${[]}`) {
let max = values.reduce(function (a, b) {
return Math.max(a, b);
}, -Infinity);
return max;
} else {
return 0;
}
}