Receiver vs. return value:
Returns block result | Returns receiver | |
---|---|---|
Receiver available as it |
let |
also |
Receiver available as this |
run |
apply |
How to read the table:
val returnValue = "Receiver".let {
println("$it is the receiver")
"Block result"
}
println(returnValue)