Skip to content

Glossary: Kotlin Basics

when

Also written: when expression

Checks one value against many branches, each written as a value, `->` and what to do. With no subject, each branch is a condition and the first true one wins.

Where the book teaches it

Related terms

if / elseexhaustiveexpression