es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
14 lines (10 loc) • 366 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function intersectionWith(firstArr, secondArr, areItemsEqual) {
return firstArr.filter(firstItem => {
return secondArr.some(secondItem => {
return areItemsEqual(firstItem, secondItem);
});
});
}
exports.intersectionWith = intersectionWith;