Joined: 2024-01-07
ββββ
2024-11-21 dev_null β edited β RE: AVincentInSpace
Itβs in Kotlin and some other languages. C# has it but there itβs actually A ?? B.
2024-11-21 dev_null β 1π¬ β RE: AVincentInSpace
Itβs a shorthand for writing this:
[β¦]
variable = if (input != null) input else default
[β¦]
ββββ
2024-11-20 dev_null β edited β RE: Cube6392
Itβs a shorthand for writing this:
[β¦]
variable = if (input != null) input else default
[β¦]
2024-11-20 dev_null β edited β 1π¬ β RE: AVincentInSpace
Because itβs not one. Ternary operator is A ? B : C, Elvis operator is A ?: B. The same two characters are involved, but both the syntax and effect is different.
ββββ