map[key] = map[key]?.let{ it -> someOperation} ?: defaultValue
3.
if(!map.contains(key)) { map.put(key, value) }
c
CLOVIS
02/23/2024, 4:13 PM
What is
someOperation
? Where did it go in the last one?
d
Devanshu Vaidya
02/23/2024, 4:25 PM
someOperations is more like adding or subtracting and in last one code is incomplete.
a
Adam S
02/24/2024, 11:56 AM
hi @Devanshu Vaidya, this channel is for Kotlin Native, but your question looks like a general Kotlin question. You might get more help in #getting-started.