forked from M3-Academy/challenge-algorithms-v2.0
Merge branch 'feature/sum'
This commit is contained in:
commit
0696bbec7e
@ -1,4 +1,6 @@
|
|||||||
export function sum(values) {
|
export function sum(values) {
|
||||||
// implementar logica aqui
|
if (values.length == 0) return 0;
|
||||||
|
const val = values.reduce((accumulator, value) => accumulator + value, 0);
|
||||||
}
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user