feat: resolve funcão sumEven

This commit is contained in:
José Gregorio Mata Rodríguez 2022-10-29 01:42:09 -02:00
parent cc1c140869
commit 1ed22cb2fa

View File

@ -1,4 +1,12 @@
export function sumEven(value) { export function sumEven(value) {
// implementar logica aqui // implementar logica aqui
let suma = 0;
let i;
if (value) {
for (i = 0; i < value.length; i++){
if (value[i] % 2 == 0)
suma+= value[i];
}
}
return suma;
} }