somando numeros pares de um array

This commit is contained in:
Carlos cristovao guerreiro scantbelruy 2022-10-28 13:12:04 -04:00
parent fefb2522c8
commit 05d962e6bd

View File

@ -1,4 +1,9 @@
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;
}