Implement a function intersectionWith(arrays, comparator) that returns an array of elements that exist in all input arrays, using a custom comparator function to determine equality.
The function should:
(a, b) => boolean to compare elements.Example
intersectionWith([[1,2,3],[2,3,4]], (a,b)=>a===b); // [2,3] intersectionWith([[{x:1},{x:2}],[{x:2},{x:3}]], (a,b)=>a.x===b.x); // [{x:2}]
JavaScript Function
No test results yet
Click "Run" to execute tests