I am currently working on a project that involves two arrays and I need to merge or join them in order to display the output in a table.
var array1 = ["a","b"];
var array2 = ["x", "y"];
While I am aware of methods like concat
and push
, I haven't been able to find a method that fits my specific needs, as concat
simply adds to the array without the desired output.
The result I'm expecting is
var combinedarray = ["x and a","y and b"];