feat(maxValue): Feito terceiro exercício

This commit is contained in:
Vinícius Gabriel 2022-10-28 07:50:23 -03:00
parent a1ec8d56f1
commit 6f9cc49cb7

View File

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