feat: implementa função do valor maximo

This commit is contained in:
RodrigoJorge 2022-10-28 15:01:52 -03:00
parent 7797328211
commit 70f64ffee3

View File

@ -1,4 +1,13 @@
export function maxValue(values) { export function maxValue(values) {
// implementar logica aqui // implementar logica aqui
let maior = -100;
for(let i = 0;i < values.length;i++){
if(values[i] > maior){
maior = values[i];
}
}
if (values.length == 0){
maior = 0;
}
return maior;
} }