Sleepzy@feddit.it to Programmer Humor · 3 days agoElvisfeddit.itimagemessage-square29fedilinkarrow-up1153arrow-down18
arrow-up1145arrow-down1imageElvisfeddit.itSleepzy@feddit.it to Programmer Humor · 3 days agomessage-square29fedilink
minus-squaredev_nulllinkfedilinkarrow-up2·edit-24 hours agoIt’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.
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.