challenge-algorithms-v2.0-M.../06-sum/index.js

20 lines
444 B
JavaScript
Raw Normal View History

export function sum(values) {
// implementar logica aqui
2022-11-02 12:56:07 +00:00
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, -32];
var sum = 0;
}
for(var i =0;i<numbers.length;i++){
sum+=numbers[i];
}
console.log(sum);