Skip to content

Instantly share code, notes, and snippets.

@eduardonunesp
Last active May 29, 2019 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduardonunesp/9a2ec96e2dc452dd556d806ebcc8973b to your computer and use it in GitHub Desktop.
Save eduardonunesp/9a2ec96e2dc452dd556d806ebcc8973b to your computer and use it in GitHub Desktop.
const flatten = (array) => {
const flat = [].concat(...array);
return flat.some(Array.isArray) ? flatten(flat) : flat;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment