Skip to content

Glossary: Kotlin Basics

if / else

Also written: if, else if, else

`if` runs a block only when its condition is true, `else if` adds another check, and `else` catches the rest. It can also give a value, and then it needs an `else`.

Where the book teaches it

Related terms

whenexpressionblock