Scope Functions
let, run, with, apply and also scope functions explained.
1
scope functions
2let Scope Function in Kotlin
let executes a block with object as argument. A Kotlin example with source code and sample output.
scope functions
3run Scope Function in Kotlin
run executes block with object as receiver (this). A Kotlin example with source code and sample output.
scope functions
4with Scope Function in Kotlin
with is a non-extension function that calls block on object. A Kotlin example with source code and sample output.
scope functions
5apply Scope Function in Kotlin
apply configures object using receiver block. A Kotlin example with source code and sample output.
scope functions
also Scope Function in Kotlin
also performs side effects and returns original object. A Kotlin example with source code and sample output.