0Pricing
Kotlin Academy · Lesson

Choosing the Right Scope Function: Decision Guide

Select the correct scope function based on receiver, return type, and intent.

Five Functions, Two Axes

Kotlin's scope functions vary on two axes: receiver style (this or it) and return value (receiver or lambda result). Pick based on intent.

The Decision Matrix

apply: this / receiver. also: it / receiver. run: this / lambda. let: it / lambda. with: this / lambda (no receiver via dot).

All lessons in this course

  1. apply and with: Configure and Return
  2. let and run: Transform and Scope
  3. also: Side Effects Without Changing the Receiver
  4. Choosing the Right Scope Function: Decision Guide
← Back to Kotlin Academy