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

16 lines
237 B
JavaScript

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