Created
May 24, 2016 07:41
-
-
Save mahadazad/c991f59d55f0bc9b25ec06710d1fca71 to your computer and use it in GitHub Desktop.
Flatten array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flatten = e => { | |
return e.reduce((i, e) => i.concat(Array.isArray(e) ? flatten(e) : e), []); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment