feat(maxValue): Adicionando algoritmo que retorna o valor maximo de um vetor. #3

Merged
SavioCarvalhoMoraes merged 1 commits from feature/maxValue into development 2022-10-30 17:37:44 +00:00

View File

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