forked from M3-Academy/challenge-algorithms-v2.0
12 lines
217 B
JavaScript
12 lines
217 B
JavaScript
export function maxValue(values) {
|
|
// implementar logica aqui
|
|
if (values.length) {
|
|
let max = -Infinity;
|
|
|
|
for (let num of values) {
|
|
max = num > max ? num : max;
|
|
}
|
|
return max;
|
|
}
|
|
return 0;
|
|
} |