Is there anyway to merge arrays in javascript by ordering by index/position. I’m try to accomplish this and haven’t been able to find any examples of this.
var array1 = [1,2,3,4]
var array2 = [a,b,c,d]
var array3 = [!,@,#,$]
var merged array = [1,a,!,2,b,@,3,c,#,4,d,$]
I know you can use concat() to put one after the other.
This should work for arrays of ANY length:
Example:
This would work also (a little more terse syntax):