forked from M3-Academy/challenge-algorithms-v2.0
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:
commit
0450a76176
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user