I have a multidimensional JavaScript array with some string data.
var array = [];
array[0] = ["A","B","C"];
array[1] = ["G","H"];
I want to merge these together into a new array.
Value 1 from the first array should merge with value 1 from array 2 and so on.
Of course, I can do like this.
var array2 = array[0][0] + array[1][0];
But I don't the data so the first array could hold 6 values and there could also be more than 2 arrays.
Is there a way to dynamically iterate over the multidimensional array and create a new array.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…