November 2019
Intermediate to advanced
448 pages
15h 6m
English
WebAssembly has several control flow statements available, like block, loop, and if. Blocks and loops have no effect on the values on the stack and are simply constructs that have a sequence of instructions and a label. A block can be used to specify a label for use with the branching pattern the code needs.
Writing if blocks is interesting because there are multiple ways that they can be structured. Both the then and else branches of the if block are optional. When using the stack machine style, the then statement is implied. In both styles—stack or nested s-expression—you can use a block statement rather than the then statement because a block statement is just a series of instructions with ...
Read now
Unlock full access