Detecting Matches in arrays

For example, I want to see if SelectedItem.tag.Enchantments[7].id matches any Enchantments[Any index].id Is that possible? If so how would i do it
Continue to help post