forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat(desafio07):desafio-completo' (#7) from feature/desafio07 into develop
Reviewed-on: #7
This commit is contained in:
commit
c0f024b168
@ -1,4 +1,13 @@
|
|||||||
export function sumEven(value) {
|
export function sumEven(value) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
const newArray = value;
|
||||||
|
var i;
|
||||||
|
let total = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < newArray.length; i++) {
|
||||||
|
if (newArray[i] % 2 === 0) {
|
||||||
|
total = total + newArray[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return total;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user