Skip to content

Instantly share code, notes, and snippets.

@yantakus
Last active March 27, 2019 16:11
Show Gist options
  • Save yantakus/14993213b44d7375c858beaab922d15b to your computer and use it in GitHub Desktop.
Save yantakus/14993213b44d7375c858beaab922d15b to your computer and use it in GitHub Desktop.
const flatten = (array) =>
array.reduce((acc, cur) =>
acc.concat(Array.isArray(cur) ? flatten(cur) : cur), []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment