Created
April 22, 2016 17:22
-
-
Save okiroth/11558b0e7037378a32c48dad7c87783e 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