Created
November 20, 2018 12:43
-
-
Save witalobenicio/16f1cb968bffbb8dbc588393bc2f45ad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function witaloFlatten(arr) { | |
return arr.reduce((flat, next) => | |
flat.concat(Array.isArray(next) ? witaloFlatten(next) : next), []); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment