https://kotlinlang.org logo
b

bodiam

12/21/2016, 10:07 PM
hi! I'm trying to use withDefault on my map. I'm having the following code:
val map = mapOf("john" to "apple", "richard" to "pear", "bob" to "banana").withDefault { x: String -> "strawberries" }
, but when doing
val value = map.get("erik")
the value is
null
.