intersect

Returns a set containing elements of this array that are also contained in the specified other array.

infix fun <T> Array<out T>.intersect(other: Iterable<T>): Set<T>(source)
val fruits = arrayOf("apple", "banana", "cherry", "date")
val favorites = listOf("banana", "date", "fig", "grape")

val common = fruits intersect favorites

println(common)   // Output: [banana, date]

Source