Created
December 16, 2013 14:46
-
-
Save dbrockman/7988118 to your computer and use it in GitHub Desktop.
Flatten 2D array
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
function flatten2D(array) { | |
return array.reduce(function (result, item) { | |
return result.concat(item); | |
}, []); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment