return
, break
, and repeat
are terminated by the end
keyword.if
block. Otherwise, if there is an elseif
statement, that condition is also tested and has the exact same behavior as an if
statement. If none of those conditions evaluate to true, the else
block is executed. Each if
statement should be accompanied by an end
to terminate the control structure, you should not place them for any else
or elseif
s you may place. Each statement may only contain one if
, any number of elseif
s, one else
, and finally one end
.false
or nil
), the print will be executed. Otherwise, nothing will happen.x - y
is 40, which is not less than 10 nor 20, resulting in the last print being executed, since the else
keyword is a fallback in the case that no other conditions are truthy.start
, and stops at the number provided for stop
. The loop variable gets incremented by the step
each iteration, the default being 1.1, 2, 3, 4, 5
, if the condition to the if
statement is false, the default is used. However, if arg
evaluates to true in the if
statement, 1, 2, 3
will be returned and not 1, 2, 3, 4, 5
, since return breaks out of the function, the rest of the code will not be executed.