I have the following array
var x = [{"id":"757382348857","title":"title","handle":"linkhere","productimage":"url","ippid":true,"location_x":26,"location_y":18}]
And i am trying to add the following array into it
var y = [{"id":"75769d11","title":"newtitle"}]
What i am trying to do is to merge somehow the 2 arrays into 1. The final array should be
[{"id":"757382348857","title":"title","handle":"linkhere","productimage":"url","ippid":true,"location_x":26,"location_y":18},{"id":"75769d11","title":"newtitle"}]
Have tried
$.merge(x,y)
// x.join(y)
// x.push(y)
javascript
x.concat(y)
Any idea would be useful. Regards
x.push(y[0])x.concat(y)worked for me. What is the issue?