Array Intersection
function arrInt(arrOne, arrTwo) {
const arrOneSet = new Set(arrOne);
return arrTwo.filter((el) => arrOneSet.has(el));
}
arrInt([1, 2, 3], [2, 3, 4]);
function arrInt(arrOne, arrTwo) {
const arrOneSet = new Set(arrOne);
return arrTwo.filter((el) => arrOneSet.has(el));
}
arrInt([1, 2, 3], [2, 3, 4]);