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

9 lines
137 B
JavaScript
Raw Permalink Normal View History

export function sum(values) {
2022-10-28 21:16:14 +00:00
let total = 0;
for(let i = 0; i < values.length; i++){
total += values[i];
} return total;
}