What would be the best way to combine the two arrays below to get the desired result. I would want them to be combined by index.
Input is:
var array1 = [[1,2,3,4],[4,5,6,7]]
var array2 = [[a,b,c,d],[e,f,g,h]]
Desired output would be:
var array3 =[{
array1:[1,2,3,4],
array2:[a,b,c,d]
},
{
array1:[4,5,6,7],
array2:[a,b,c,d]
}]
Any variation of the output would work as long as they are grouped by indexes. Thanks in advance.
EDIT: not a duplicate of what was suggestion. Suggestion out [a,1,b,2] and does not group the way the desired output shows.