Is there any shorthand for `if (condition) a else ...
# announcements
r
Is there any shorthand for
if (condition) a else b
?
t
rockerhieu: afaik, No.
Copy code
In Kotlin, if is an expression, i.e. it returns a value. Therefore there is no ternary operator (condition ? then : else), because ordinary if works fine in this role.