Travis build: 180

This commit is contained in:
Travis CI
2017-12-23 10:04:21 +00:00
parent 9356cd5494
commit d1ba6c42ff
2 changed files with 4 additions and 4 deletions

View File

@@ -483,10 +483,10 @@ const filterNonUnique = arr => arr.filter(i => arr.indexOf(i) === arr.lastIndexO
Flattens an array.
Use `Array.reduce()` to get all elements inside the array and `concat()` to flatten them.
Use a new array and concatenate it with the spread input array causing a shallow denesting of any contained arrays.
```js
const flatten = arr => arr.reduce((a, v) => a.concat(v), []);
const flatten = arr => [ ].concat( ...arr );
// flatten([1,[2],3,4]) -> [1,2,3,4]
```