Get most matched Classes

const intersection = yourArray.filter(item1 => yourOtherArray.some(item2 => item2 === item1))
Was this page helpful?