forked from M3-Academy/challenge-algorithms-v2.0
somando numeros pares de um array
This commit is contained in:
parent
fefb2522c8
commit
05d962e6bd
@ -1,4 +1,9 @@
|
|||||||
export function sumEven(value) {
|
export function sumEven(value) {
|
||||||
// implementar logica aqui
|
let result = 0;
|
||||||
|
for(let i = 0; i <= value.length; i++){
|
||||||
|
if(i % 2 === 0){
|
||||||
|
result += i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user