07-resolvido

This commit is contained in:
Emilly Schuenck de Lima 2022-11-01 16:05:01 -03:00
parent d6eb8289d7
commit 79b6f8cb2b

View File

@ -1,4 +1,17 @@
import { sum } from "../06-sum";
export function sumEven(value) {
// implementar logica aqui
let par = []
for (let i = 0; i < value.length; i++) {
if (value[i] % 2 == 0) {
par.push(value[i])
}
}
let total = 0
for (let i = 0; i < par.length; i++) {
total += par[i];
}
value = [];
return total;
}