challenge-algorithms-v2.0-a.../07-sumEven/index.js

14 lines
255 B
JavaScript

export function sumEven(value) {
// implementar logica aqui
let soma = 0;
for (let number of value) {
if (value.length === 0) {
return 0;
} else
if (number % 2 === 0) {
soma = soma += number;
}
}
return soma;
}