feat: adicionando solução do 7° desafio

This commit is contained in:
Ana Carolina Duarte Cavalcante 2022-10-28 08:41:18 -03:00
parent 6d91bf9bcb
commit e7ebd59708

View File

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