October 2018
Intermediate to advanced
370 pages
9h 15m
English
Kotlin provides an alternative method to the if statement—the When expression. When can also be perceived as a filter method. This is similar in nature to the Switch statement in Java or C. When sequentially matches its arguments with all branches until a condition is satisfied for a branch.
The When expression works as follows:
Writing the When statement:
Read now
Unlock full access