64 ms·
a = if b > 1 { 1 } else { 2 } is equivalent to: a = b > 1 ? 1 : 2 in other languages. Meaning that the if/else statement can be used as an expression that
by readams 11y ago
a = if b > 1 { 1 } else { 2 }
is equivalent to:
a = b > 1 ? 1 : 2
in other languages. Meaning that the if/else statement can be used as an expression that can provide an rvalue of integer type.