forked from M3-Academy/challenge-algorithms-v2.0
feat(maxValue): desenvolvimento da funcao
This commit is contained in:
parent
2766fa2594
commit
2fcbcd717c
@ -1,4 +1,13 @@
|
||||
export function maxValue(values) {
|
||||
// implementar logica aqui
|
||||
|
||||
if(values.length === 0){
|
||||
return 0;
|
||||
}
|
||||
let maior = values[0];
|
||||
|
||||
values.map(element =>{
|
||||
if (element > maior)
|
||||
maior = element;
|
||||
});
|
||||
return maior;
|
||||
}
|
Loading…
Reference in New Issue
Block a user