feat: adicionando solução do 3° desafio

This commit is contained in:
Ana Carolina Duarte Cavalcante 2022-10-28 08:06:45 -03:00
parent ae920dca29
commit d8ba6787ab

View File

@ -1,4 +1,12 @@
export function maxValue(values) {
// implementar logica aqui
if (values.length) {
let max = -Infinity;
for (let num of values) {
max = num > max ? num : max;
}
return max;
}
return 0;
}