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

8 lines
148 B
JavaScript
Raw Normal View History

export function sum(values) {
2022-10-28 12:17:33 +00:00
var arr = values;
var soma = 0;
for(var i = 0; i < arr.length; i++) {
soma += arr[i];
}
return soma;
}