https://kotlinlang.org logo
#announcements
Title
# announcements
r

rockerhieu

06/26/2017, 2:21 PM
Is there any shorthand for
if (condition) a else b
?
t

thuanle

06/26/2017, 4:51 PM
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.
9 Views