forked from M3-Academy/challenge-algorithms-v2.0
12 lines
232 B
JavaScript
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;
|
|
}
|
|
}
|