Ternary Conditional Operator
There is only one ternary conditional operator, the ternary conditional operator (a ? b : c
).
It behaves like an if-statement, but is an expression: If the first operator value is true, the second operator value is returned. If the first operator value is false, the third value is returned.
The first value must be a boolean (must have the type Bool
). The second value and third value can be of any type. The result type is the least common supertype of the second and third value.
Last updated