JS Arrays Periksa apakah ada persimpangan

// Use a combination of Array.prototype.filter and Array.prototype.includes:
const filteredArray = array1.filter(value => array2.includes(value));
GutoTrosla