Created
June 27, 2016 19:23
-
-
Save andresmijares/cbc53e53c30929c4defa452cd1a8b2c0 to your computer and use it in GitHub Desktop.
flatter arr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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