Merge pull request 'feat(sumEven): adiciona funcao que soma os elementos pares de um array' (#7) from feature/sumEven into master

Reviewed-on: #7
This commit is contained in:
ViniciusDeniz 2022-11-02 22:24:13 +00:00
commit 3ae8a1d9c6

View File

@ -1,4 +1,12 @@
export function sumEven(value) { export function sumEven(value) {
// implementar logica aqui // implementar logica aqui
let soma = 0;
for (i in value) {
if (value[i] % 2 != 0) {
continue;
} else {
soma += value[i];
}
}
return soma;
} }