Kotlin Tutorial #11: Scope Functions — let, run, with, apply, also
In the previous tutorial, you learned about extension functions. Now let’s learn about scope functions. Kotlin has five scope functions: let, run, with, apply, and also. They execute a block of code on an object and differ in how they refer to the object and what they return. Watch the Video: Prefer watching? Check out the video version of this tutorial on YouTube. These functions are used everywhere in Kotlin code. Understanding them will make your code cleaner and more readable. ...