Merge pull request 'feat(maxValue): Adicionando algoritmo que retorna o valor maximo de um vetor.' (#3) from feature/maxValue into development

Reviewed-on: #3
This commit is contained in:
Savio Carvalho Moraes 2022-10-30 17:37:44 +00:00
commit 79fa78887a

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;
}
}