feat: resolucao funcao sum

This commit is contained in:
Guilherme de Camargo Barbosa 2022-10-29 17:34:11 -03:00
parent 938bfcee0f
commit 10b8d54684

View File

@ -1,4 +1,14 @@
export function sum(values) {
// implementar logica aqui
let soma = 0
if(values.length == 0) return 0
for (let i = 0; i < values.length; i++) {
soma += values[i]
}
return soma
}
}
sum([1, 2, 3, 4, 5])