Created
April 22, 2016 17:21
-
-
Save okiroth/c6aa19ad33c8ac55a65970561e36c3a8 to your computer and use it in GitHub Desktop.
flatten array in Javascript
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
| var result = []; | |
| for (var i = 0; i < source.length; ++i) { | |
| for (var j = 0; j < source[i].length; ++j) | |
| result.push(source[i][j]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment