Skip to content

Instantly share code, notes, and snippets.

@alexandrricov
Created April 19, 2016 06:39
Show Gist options
  • Save alexandrricov/001de858d962146e5116b65f58eaa168 to your computer and use it in GitHub Desktop.
Save alexandrricov/001de858d962146e5116b65f58eaa168 to your computer and use it in GitHub Desktop.
var flatten = arr =>
arr.reduce((p, c) =>
p.concat(Array.isArray(c) ? flatten(c) : c),
[]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment