forked from M3-Academy/challenge-algorithms-v2.0
feature: resolve exercício 06-sum
This commit is contained in:
parent
adfcec5277
commit
bbf4259fcb
@ -1,4 +1,4 @@
|
|||||||
export function sum(values) {
|
export function sum(values) {
|
||||||
// implementar logica aqui
|
if(values.length < 1) return 0;
|
||||||
|
return values.reduce((previousValue, currentValue) => previousValue + currentValue);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user