Created
December 31, 2018 15:23
-
-
Save seanbrwh/de942b5e7b16e7eda17c336c5789d60b to your computer and use it in GitHub Desktop.
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
let flatten = (arr) => { | |
return arr.reduce((curr, prev)=>{ | |
return curr.concat(Array.isArray(prev) ? flatten(prev) : prev); | |
}, []); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment