Rest
...arrays: any[]The arrays to inspect.
Returns the new array of intersecting values.
5.11.0
const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]
intersectionWith(objects, others, isEqual)
// => [{ 'x': 1, 'y': 2 }]
This method is like
intersection
except that it acceptscomparator
which is invoked to compare elements ofarrays
. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: (arrVal, othVal).