forked from M3-Academy/challenge-algorithms-v2.0
feat(maxValue): Feito terceiro exercício
This commit is contained in:
parent
a1ec8d56f1
commit
6f9cc49cb7
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user