DRAFT
Observed
The conditional operator is not an expression
The conditional operator is not an expression
The conditional operator (often called “ternary operator”) is an expression and, as a such, evaluates to a certain value.
In a case like cond ? expr1 : expr2
, the whole expression evaluates to whatever expr1
evaluates to when cond
is true
and to whatever expr2
evaluates to when cond
is false
.