For AI agents: Documentation index at /llms.txt

Skip to content

Control flow

Control flow in Motoko is expression-oriented: blocks, conditionals, switch, and loops are all expressions that evaluate to a value. This section covers each construct and the patterns that compose them.