forked from M3-Academy/challenge-algorithms-v2.0
11 lines
216 B
JavaScript
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;
|
|
}
|
|
} |