forked from M3-Academy/challenge-algorithms-v2.0
12 lines
324 B
JavaScript
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;
|
|
} |