Skip to content

Commit

Permalink
Merge f629d83 into f351692
Browse files Browse the repository at this point in the history
  • Loading branch information
terrierscript committed May 3, 2019
2 parents f351692 + f629d83 commit b9851e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ Flattens array a single level deep.
const flatten = [1, [2, [3, [4]], 5]].reduce( (a, b) => a.concat(b), [])
// => [1, 2, [3, [4]], 5]

// Native(ES2019)
const flatten = [1, [2, [3, [4]], 5]].flat()
// => [1, 2, [3, [4]], 5]
```

#### Browser Support for `Array.prototype.reduce()`
Expand All @@ -481,6 +484,11 @@ Recursively flattens array.

flattenDeep([1, [[2], [3, [4]], 5]])
// => [1, 2, 3, 4, 5]

// Native(ES2019)
[1, [2, [3, [4]], 5]].flat(Infinity)
// => [1, 2, 3, 4, 5]

```

#### Browser Support
Expand Down

0 comments on commit b9851e1

Please sign in to comment.