challenge-algorithms-v2.0-n.../06-sum/index.js
2022-10-28 10:39:05 -03:00

13 lines
215 B
JavaScript

export function sum(values) {
// implementar logica aqui
if (values.length === 0) {
return 0;
}
let sum = values.reduce(function(accumulator,value){
return accumulator + value;
})
return sum
}