Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andresmijares/cbc53e53c30929c4defa452cd1a8b2c0 to your computer and use it in GitHub Desktop.
Save andresmijares/cbc53e53c30929c4defa452cd1a8b2c0 to your computer and use it in GitHub Desktop.
flatter arr
const flatten = list => list.reduce(
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment