Scala doesn’t have an extensive list of control structures with only six control structures in total. The reason for this is that Scala allows control abstraction; the ability to create your own control structures. While control abstraction is out of the scope of this course, it is important to mention here as it is a feature unique to Scala.
Scala’s control structures are if, while, for, try, match, and function calls.
In Scala, control structures return values just like functions. With this, Scala brings a functional approach to an imperative paradigm. The ability of a control structure to return a value reduces the need to create temporary variables for holding results resulting in cleaner and more concise code.
In the next lesson, we will cover the first control structure: if.