1st observable array:
data = [{id:1 , name:'abc'},{id:2 ,name:'xyz'},{id:3 , name:'rst'}]
another array:
dataProvider = [{id:3 , name:'pqr'} , {id:4 , name:'hjk'}]
Now can we compare the data array with data provider and for id = 3 it should replace the previous object and with id = 4 it simply push the object into data array.
Therefore the new data array will something like this
data = [{id:1 , name:'abc'},{id:2 ,name:'xyz'} ,{id:3 , name:'pqr'} , {id:4 , name:'hjk'}]