I have an array of arrays of different lengths. So for instance in my test below I start with my vidArray containing 4 arrays (their length is respectively 16, 38, 49, 49).
I'd like to populate a newArray with the first value of each of the 4 arrays, then the second value of each, then the third and so on.
What I'm trying is:
// populate newArray
var newArray = []
for(let i=0; i < vidArray.length; i++){
let ar = vidArray[i]
for(let j=i; j < (i+1); j++){
newArray.push(ar[j])
}
}
console.log("newArray "+newArray)
but it seems to wrongly take the [0] from the first array, the [1] from the second array, the [3] from the third array and so on
null/terminate?