Created
November 3, 2016 00:52
-
-
Save jniemann66/3bd0e9e5cdeaf77e1b68d105c76ff33b to your computer and use it in GitHub Desktop.
Merging array of arrays into a single array
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
// merge array of arrays into a single array | |
var data = [ | |
['a','b','c'], | |
['d','e','f'], | |
['g','h','i'], | |
]; // array of arrays | |
// merge results into a single array | |
var combinedData = [].concat.apply([], data); // ['a','b','c','d' ... 'i'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment