How to check whether two arrays as common elements or not ?

const array1 = [‘canada’, ‘america’, ‘london’];
const array2 = [‘america’, ‘india’, ‘Germany’];
// Check if any common elements exist
const similarData = array1.some(item => array2.includes(item));
console.log(similarData); // true (since ‘america’ exists in both arrays)

How to check whether two arrays as common elements or not ?