Conditional
The conditional (a.k.a. `if`) is one of the most fundamental items in programming logic. Parenthesis on the if are optional. Due to this, braces are required around the code block. The rationale for this was that omitting braces can result in difficult to debug, critical bugs, as Apple has shown us[citation-needed].

# Definition

The general syntax is the following:
1
if <condition> {
2
[statement_1]
3
} [else if <condition> {
4
[statement_2]
5
} ...][else {
6
[statement_3]
7
}]
Copied!

# Examples

1
if 1 == 1 {
2
print "1 is in fact 1"
3
} else {
4
5
}
Copied!
Additionally, an arbitrary amount of `else if` blocks can be supplied:
1
var num = Math.rand(3);
2
3
if num == 1 {
4
print "Random number was 1"
5
} else if num == 2 {
6
print "Random number was 2"
7
} else if num == 3 {
8
print "Random number was 3"
9
} else {
10
print "Random number was #{num}"
11
}
Copied!

# Scoping

Ifs, like all other code-blocks in Cheddar are block scoped. The condition of the if is evaluated in the parent's context, meaning the new scope will only be created, once the condition has been validated and the code-block is ready to execute.