Shorthand Notation for Simple Functions

Learn when and how to write functions in shorthand notation for concise and readable code.

Functions that simply return the result of a single expression can be abbreviated in Kotlin.

Refactoring a Function #

Consider the following function:

Get hands-on with 1200+ tech skills courses.