If #
With if
and else
keywords the flow of a program can be controlled.
π > if (a.type() == "STRING") {
puts("is a string")
} else {
puts("is not a string")
}
// which prints
is a string
π Since
0.13
curly braces are completely optional (closing brace needs to be replaced withend
)
π > if (a.type() == "STRING")
puts("is a string")
else
puts("is not a string")
end
// which prints
is a string