Control Flow

Control flow refers to the order in which a program is executed. We discuss three common control flow constructs in Motoko: if expressions, if else expressions and switch expressions.

These constructs are called expressions because they evaluate to a value of a certain type.