Join Slack
Communities
Powered by
why does `withDefault` for maps only works when ma...
# getting-started
n
nkiesel
02/23/2017, 10:15 AM
why does
withDefault
for maps only works when map is used as a delegate? I assumed
println(mapOf(1 to "a", 2 to "b").withDefault({ k-> "x" })[3])
would print
x
Open in Slack
Previous
Next