Updated snippets
Mainly for better readability
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
Use `reduce()` to add each value to an accumulator, initialized with a value of `0`.
|
||||
|
||||
```js
|
||||
const sum = arr =>
|
||||
arr.reduce( (acc , val) => acc + val, 0);
|
||||
const sum = arr => arr.reduce( (acc , val) => acc + val, 0);
|
||||
// sum([1,2,3,4]) -> 10
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user