challenge-algorithms-v2.0-M.../07-sumEven/index.js
2022-11-02 10:09:57 -03:00

22 lines
529 B
JavaScript

export function sumEven(value) {
// implementar logica aqui
var numbers = [1];
var numbers = [1, 2];
var numbers = [1, 2, 3];
var numbers = [1, 2, 3, 4];
var numbers = [4, 6, 12, 5];
var numbers = [9, 234, 312, 999, 21, 2311];
var numbers = [533, 234, 23423, 32, 48876];
var numbers = [-1, 5, -10, -45];
var numbers = [-2, -7, -31];
var numbers = [-2, 20, -31];
var sum = 0;
}
let result = 0;
for (let i = 0; i <= numberIndex; i++) {
if (i % 2 === 0) {
result += i;
}
}
return result;