np

if (statement)

Description

if statements are used to express conditionality in code. If the given condition evaluates to true, the next statement or block gets executed.

Simple If

Here's how you can use the if statement in its shortest-possible form:

if 1==1 print('just checking!')

The condition part can also be followed by a block of statements:

if 2==2 {
  print('alright, we need to talk about the creativity of these examples.')
  }

You can use elseif statements to test for other conditions in case the previous ones did not come true:

new a = 10

if a==1 {
  print('one')
  }
elseif a==10 {
  print(10)
  }
else
  print('else')