Let's say I have two arrays...
const arr1 = [ { id: 1: newBid: true } ];
const arr2 = [ { id: 1, newBid: false }, { id: 2, newBid: false } ];
My goal is to end up with an array that looks like this
[ { id: 1, newBid: false }, { id: 2, newBid: false } ]
However, I specifically want the { id: 1, newBid: true }
from arr1
and not arr2
I tried using Lodash uniqBy(arr1, arr2, ['id'])
, but it removes the first occurrence, not the second