feat: criar algoritmo que realize a soma dos numeros pares

This commit is contained in:
HUMBERTO ANTONIO CORREIA FERRO 2022-10-29 19:26:27 -03:00
parent 53eee52952
commit 88441d9bf3

View File

@ -1,4 +1,12 @@
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;
}