Created
April 5, 2016 10:31
-
-
Save amodig/627f8c00d24b67bfe7922a4a342ba761 to your computer and use it in GitHub Desktop.
JS flatten array of arrays
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
var arrays = [[1, 2, 3], [4, 5], [6]]; | |
console.log(arrays.reduce(function(a, b) { | |
return a.concat(b); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment