It's a shorthand for writing this:
variable = if (input != null) input else default
This is equivalent:
variable = input ?: default
Huh. Neat feature.
It's in Kotlin and some other languages. C# has it but there it's actually A ?? B.
A ?? B
Post funny things about programming here! (Or just rant about your favourite programming language.)
It's a shorthand for writing this:
This is equivalent:
Huh. Neat feature.
It's in Kotlin and some other languages. C# has it but there it's actually
A ?? B.