Chapter 2. Control Flow
The following recipes will be covered in this chapter:
- Assigning result to an expression using the
ifkeyword
- Using range with the
whenexpression
- Using
whenwith custom objects
- Using
try–catchas an expression
- How to write a swap function in Kotlin using the
alsofunction
- How to throw a custom exception in Kotlin
- How to make a multiconditional loop in Kotlin