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

6 lines
145 B
JavaScript
Raw Permalink Normal View History

export function sum(values) {
2022-10-29 00:19:21 +00:00
let sumAll = 0;
for (let i = 0; i < values.length; i++) {
sumAll = sumAll + values[i];
} return sumAll;
}