From d1ba6c42ff4a27646f83adca94ef1c7b634768d4 Mon Sep 17 00:00:00 2001
From: Travis CI
Date: Sat, 23 Dec 2017 10:04:21 +0000
Subject: [PATCH] Travis build: 180
---
README.md | 4 ++--
docs/index.html | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index b68f397e5..8556ec300 100644
--- a/README.md
+++ b/README.md
@@ -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]
```
diff --git a/docs/index.html b/docs/index.html
index dc8296a8e..0c1ea6384 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -367,8 +367,8 @@ Returns the remaining elements.
flatten
Flattens an array.
-
Use Array.reduce() to get all elements inside the array and concat() to flatten them.
-
const flatten = arr => arr.reduce((a, v) => a.concat(v), []);
+Use a new array and concatenate it with the spread input array causing a shallow denesting of any contained arrays.
+const flatten = arr => [ ].concat( ...arr );
// flatten([1,[2],3,4]) -> [1,2,3,4]