JS Periksa apakah dua array memiliki elemen yang sama
const intersection = array1.filter(element => array2.includes(element));
Lonely Loris
const intersection = array1.filter(element => array2.includes(element));
// if not nested arrays
function checkEquals(arr1, arr2) {
return arr1.every( el => arr2.includes(el) );
};