Skip to main content

Ternary operator in Kotlin

Ternary operator in Kotlin?

In Kotlin, the if statement can be used like an expression. See below:

val twoEqualThree = if (2 == 3) 5 else 6

Comments