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

12 lines
324 B
JavaScript

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