Javascript – Compare two array of objects and push or pop objects from first array based on second array
consider below 2 array of objects, say arr1 and arr2. based on id, if any new item exist in arr2 copy item to arr1 and remove item from arr1 if that item not present in arr2. Tried something like this,…