Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

If and Else

Basic if

x = 10
if x > 5 {
  write("big")
}

If/else

x = 2
if x > 5 {
  write("big")
} else {
  write("small")
}

If/orif/else

x = 5
if x > 10 {
  write("big")
} orif x > 3 {
  write("medium")
} else {
  write("small")
}

You can chain as many orif blocks as you need. elif still works as an alias.

Inline conditions

You can put small blocks on one line:

if x > 5 { write("big") } else { write("small") }