Control flow
Overview
Blocks of statements are generally executed linearly. However, statements are the primary place where this flow of execution can be controlled.
Carbon’s flow control statements are:
if
andelse
provides conditional execution of statements.- Loops:
return
ends the flow of execution within a function, returning it to the caller.