Kotlin & Coroutines (50 Qs)•Part 1: Core Language, Type System & Syntax (1 - 10)
Explain Kotlin Scope Functions: let, run, with, apply, and also?
junior LevelkotlinCore Language
In Simple Words:
apply: Context isthis, returns context object (ideal for object initialization).also: Context isit, returns context object (ideal for side-effects/logging).let: Context isit, returns lambda result (ideal for null-checks?.let).run: Context isthis, returns lambda result (ideal for computation on object).with: Non-extension function taking object as argument, returns lambda result.