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

6 lines
145 B
JavaScript

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