miha-x64
11/11/2016, 11:14 AMobj.let { it.action() }
if equivalent to obj.action()
.
In obj?.let { … }
the obj
is nullable, and it
is nun-null so it comes very handy when you need to acces a nullable variable’s value several times when it is non-null.
This is the definition of `let`:
public inline fun <T, R> T.let(block: (T) -> R): R = block(this)