val m = mapOf<String, Int>()
m.contains("Foo")
m.containsKey("Bar")
In Kotlin, there are two methods for Map to check whether the map has specified key: contains and containsKey
I know that key in m is the idiomatic way to check key existence, but I wonder why they have two methods doing same function. Do they have any differences between them? Or are they just some sort of legacy code for compatibility?