https://kotlinlang.org logo
#codereview
Title
# codereview
t

tipsy

03/09/2020, 2:47 PM
is there are a better way than this for getting key by value?
Copy code
val key = myMap.filterValues { it == "value" }.keys.firstOrNull()
a

arekolek

03/09/2020, 2:58 PM
Copy code
myMap.entries.firstOrNull { it.value == value }?.key
👍 1
t

tipsy

03/09/2020, 7:22 PM
Thanks!
2 Views