forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat(desafio06):desafio-completo' (#6) from feature/desafio06 into develop
Reviewed-on: #6
This commit is contained in:
commit
c41098172f
@ -1,4 +1,13 @@
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue
Block a user