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

11 lines
216 B
JavaScript

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