Skip to content

Conditions

Mel Florance edited this page Jul 23, 2020 · 3 revisions

Bird Lang supports conditionnal statements with the following keywords:

  • if
  • else
  • elseif

if

Use the if statement to specify a block of code to be executed if a condition is true:

Example:

> if 1 < 2 then true
true

else

Use the else statement to specify a block of code to be executed if the condition is false:

Example:

> if 1 > 2 then true else false
false

elseif

Use the elseif statement to specify a new condition if the first condition is false:

Example:

> if 1 == 2 then true else if 2==2 then 2 else false
2

Clone this wiki locally