if...else

The if statement executes a statement if the last item on the stack is true (1). If the condition is false (0), another statement can be executed

Try it

Syntax

wasm

i32.const 0
(if
  (then
    ;; do something
  )
  (else
    ;; do something else
  )
)
Instruction Binary opcode
if 0x04
else 0x05