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

10 lines
159 B
JavaScript
Raw Normal View History

export function sum(values) {
2022-11-02 19:37:28 +00:00
let total = 0;
for(let i = 0; i < values.length; i++){
total += values[i];
}
return total;
}