Travis build: 1792

This commit is contained in:
30secondsofcode
2018-03-09 17:39:54 +00:00
parent 1b516a8e74
commit 02a3064840
3 changed files with 3 additions and 11 deletions

View File

@ -9,11 +9,7 @@ Omit the second argument, `depth` to flatten only to a depth of `1` (single flat
```js
const flatten = (arr, depth = 1) =>
arr.reduce(
(a, v) =>
a.concat(depth > 1 && Array.isArray(v) ? flatten(v, depth - 1) : v),
[],
);
arr.reduce((a, v) => a.concat(depth > 1 && Array.isArray(v) ? flatten(v, depth - 1) : v), []);
```
```js