Which programming language is this?
val label = when (value) {
is Int -> "number"
else -> "other"
}
Answer: Kotlin
when used as an expression with is smart casts is Kotlin's pattern branch.val label = when (value) {
is Int -> "number"
else -> "other"
}
Answer: Kotlin
when used as an expression with is smart casts is Kotlin's pattern branch.