how do I map a single object to some other object?...
# getting-started
h
how do I map a single object to some other object? for example with
val key:String? = getKey() ; key?.mapSingle{ getValue(it) }?.{println(it)}
what should keyword should replace
mapSingle
r
There's also nothing wrong with just using another variable.
Copy code
val key = getKey
val value = getValue(key)
Sometimes you need to remember to fight the urge to make everything in Kotlin one line 🙂 (it can make readability a nightmare)
h
yeah I asked out of curiosity.
👍 1