Last active
August 29, 2015 14:23
-
-
Save WillSquire/ba99da1df0790776a601 to your computer and use it in GitHub Desktop.
Flatten Array - Flatten a multidimensional 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
/** | |
* Flatten a multidimensional array. | |
* | |
* @param {Array.<T>} multidimentionalArray | |
* @returns {Array.<T>} | |
*/ | |
function flattenArray(multidimentionalArray) { | |
return [].concat.apply([], multidimentionalArray); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment