feat(07-sumEven): Adiciona função

This commit is contained in:
Emerson Fully 2022-10-29 17:21:49 -03:00
parent b755e428f9
commit b74587fc2f

View File

@ -1,4 +1,11 @@
export function sumEven(value) {
// implementar logica aqui
if (value.length === 0) return 0;
let soma = 0;
for(let i = 0; i < value.length; i ++){
if(value[i] % 2 === 0){
soma = soma + value[i];
}
}
return soma;
}