forked from M3-Academy/challenge-algorithms-v2.0
22 lines
529 B
JavaScript
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; |