Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Kotlin
Kotlinmedium

Scope functions (`let`, `apply`, `also`, `run`, `with`) — how do they differ?

Tags
#scope-functions#let#apply#also
Back to categoryPractice quiz

Answer

They mainly differ by the receiver (`this` vs `it`) and the return value (receiver vs lambda result). Example: `apply` configures and returns the object; `let` transforms and returns the lambda result.

val user = User("Ada")
  .apply { active = true } // returns receiver

val nameLen = user.name.let { it.length } // returns lambda result