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

8 lines
148 B
JavaScript

export function sum(values) {
var arr = values;
var soma = 0;
for(var i = 0; i < arr.length; i++) {
soma += arr[i];
}
return soma;
}