forked from M3-Academy/challenge-algorithms-v2.0
14 lines
250 B
JavaScript
14 lines
250 B
JavaScript
export function maxValue(values) {
|
|
// implementar logica aqui
|
|
let maxV = values[0]
|
|
for(let i = 1; i < values.length; i++) {
|
|
if(maxV < values[i]){
|
|
maxV = values[i]
|
|
}
|
|
}
|
|
if(values.length == 0)
|
|
return 0;
|
|
|
|
return maxV;
|
|
|
|
} |