In Clarity, `if` is an expression that returns a value based on a condition branch. Both branches must return compatible types.
clarity (if (> u10 u5) "higher" "lower")
100 XP to Apprentice
Branching logic with expressions.
AI translates the explanation and quiz text while preserving code and answer scoring.
In Clarity, `if` is an expression that returns a value based on a condition branch. Both branches must return compatible types.
clarity (if (> u10 u5) "higher" "lower")
1. Do both branches of an 'if' expression need to return compatible types?
2. How is 'else if' structured in Clarity?