RosettaCodeData/Task/Conditional-structures/Grain/conditional-structures-1.grain
2023-07-01 13:44:08 -04:00

18 lines
363 B
Text

let x = if (1 < 2) {
":)"
} else { // The else clause is required here as x is a string
":("
}
if (2 > 3) {
print("This should never execute.")
} // We can omit the else clause here
// We use else if for chaining
if (1 > 2) {
print("1 is less than 2")
} else if (2 == 3) {
print("2 is 3")
} else {
print("This should always execute.")
}