Skip to content

Instantly share code, notes, and snippets.

@mahadazad
Created May 24, 2016 07:41
Show Gist options
  • Save mahadazad/c991f59d55f0bc9b25ec06710d1fca71 to your computer and use it in GitHub Desktop.
Save mahadazad/c991f59d55f0bc9b25ec06710d1fca71 to your computer and use it in GitHub Desktop.
Flatten array
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