challenge-algorithms-v2.0-n.../07-sumEven/index.js
2022-10-28 10:42:47 -03:00

13 lines
261 B
JavaScript

export function sumEven(value) {
// 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;
}