Merge pull request 'feat:cria algoritmo que retorne a soma de todos os números pares de um array' (#7) from feature/sumEven into development/desafio-02

Reviewed-on: EmmanuelVitor/challenge-algorithms-v2.0-EmmanuelVitor#7
This commit is contained in:
Emmanuel Vitor Pereira de Jesus 2022-10-31 16:53:08 +00:00
commit 0450a76176

View File

@ -1,4 +1,11 @@
export function sumEven(value) {
// implementar logica aqui
let resultEvenSum = 0;
value.forEach(element => {
if ((element % 2) === 0) {
resultEvenSum += element;
}
});
return resultEvenSum;
}