Kotlin Tutorial #6: Control Flow — if, when, for, while
In the previous tutorial, you learned about functions. Now let’s learn about control flow — how to make decisions and repeat actions in your code. Watch the Video: Prefer watching? Check out the video version of this tutorial on YouTube. Kotlin’s control flow is similar to Java, but with important improvements. if and when are expressions that return values. when replaces switch and is much more powerful. In this tutorial, you will learn: ...