update snippets 1-15
This commit is contained in:
committed by
Agamemnon Zorbas
parent
aaeb11616c
commit
5036ff5781
@ -6,5 +6,8 @@ Use `Array.reduce()` to add each value to an accumulator, initialized with a val
|
||||
|
||||
```js
|
||||
const arraySum = arr => arr.reduce((acc, val) => acc + val, 0);
|
||||
// arraySum([1,2,3,4]) -> 10
|
||||
```
|
||||
|
||||
```js
|
||||
arraySum([1,2,3,4]) -> 10
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user