Function to find the intersection result between two array with a given comparator
Optional
{Array}
intersecionWith([{x: 1, y: 2}, {x: 2, y: 3}], [{x: 2, y: 3}, {x: 4, y: 5}], (arrVal, otherVal) => arrVal.x === otherVal.x)// return [{x: 2, y: 3}] Copy
intersecionWith([{x: 1, y: 2}, {x: 2, y: 3}], [{x: 2, y: 3}, {x: 4, y: 5}], (arrVal, otherVal) => arrVal.x === otherVal.x)// return [{x: 2, y: 3}]
intersectionWith([1, 2, 3], [3, 4, 5], undefined);// return [3] Copy
intersectionWith([1, 2, 3], [3, 4, 5], undefined);// return [3]
Function to find the intersection result between two array with a given comparator