It's a shorthand for writing this:
variable = if (input != null) input else default
This is equivalent:
variable = input ?: default
The answers confusing it with the ternary operator are wrong.
Post funny things about programming here! (Or just rant about your favourite programming language.)
It's a shorthand for writing this:
This is equivalent:
The answers confusing it with the ternary operator are wrong.