2022-10-27 15:07:13 +00:00
|
|
|
export function sum(values) {
|
|
|
|
// implementar logica aqui
|
2022-10-28 13:39:05 +00:00
|
|
|
if (values.length === 0) {
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
let sum = values.reduce(function(accumulator,value){
|
|
|
|
return accumulator + value;
|
|
|
|
})
|
|
|
|
|
|
|
|
return sum
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|