Need Assistance?

support@tutorialshub.in

Scope Functions (let, run, with, apply, also)

Scope Functions Overview (this vs it)

ADVERTISEMENT
Kotlin Free Lesson
5 min read
ADVERTISEMENT

Kotlin's 5 scope functions differ in only two ways: 1) how they reference the object (this vs it), and 2) what they return (the object itself vs the lambda result):

  • let (it, returns lambda result) | also (it, returns object)
  • apply (this, returns object) | run & with (this, returns lambda result)
ADVERTISEMENT
Hi, I'm Tuby! Here to help you