Last active
January 13, 2018 13:11
-
-
Save pratyushcrd/02c48a5a9d0aba2393662910b0d7ca9e 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
const flatten = arr => arr | |
.reduce((a, b) => a.concat(b)) | |
// Execution | |
flatten([ | |
[1, 2, 3], | |
[4, 5], | |
[6] | |
]) | |
Output : [1, 2, 3, 4, 5, 6] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment