Merge pull request 'feat(challenge-6): completed challenge' (#6) from feature/challenge-6 into develop

Reviewed-on: #6
This commit is contained in:
Henrique Santos Santana 2022-10-28 00:04:27 +00:00
commit e650ec9d21

View File

@ -1,4 +1,9 @@
export function sum(values) {
// implementar logica aqui
}
if (values.length === 0 || !values) return 0;
// acc é abreviação de accumulator(acumulador)
return values.reduce((acc, number) => {
return (acc += number);
}, 0);
}