I have two arrays of object. These two array contain huge data. I want to merge this two array into one. What is the efficient way to do this?
ex:
var firstArray= [ {id:1, a:'b'}
{id:2, c:'d'}
...
]
var secondArray= [ {id:1, z:'1'}
{id:2, y:'2'}
...
]
Output should look like:
var resultingArray= [ {id:1, a:'b',z:'1'}
{id:2, c:'d',y:'2'}
...
]