Add a simple example for sum

This commit is contained in:
Larry Lu
2018-12-05 17:53:52 +08:00
parent cc71e41d30
commit 68b003f93b

View File

@ -9,5 +9,6 @@ const sum = (...arr) => [...arr].reduce((acc, val) => acc + val, 0);
```
```js
sum(1, 2, 3, 4); // 10
sum(...[1, 2, 3, 4]); // 10
```