`.let` is `map` on an `Option` `?.` notation is `...
# arrow
c
.let
is
map
on an
Option
?.
notation is
flatMap
on an
Option
Your thoughts?
s
Both
?.let
and
?.
can be a map or flatmap… depends 🙂
Copy code
val value: String? = ... 

val size = value?.length
val size = value?.let { it.length }
But, I agree, the
?.let
lets you write a flatMap like expression easier:
Copy code
string2?.let { string1?.concat(it) } 
or
string1?.let { it1 -> string2?.let { it1 + it } }
Still, not quite like flatMap 🙂