From Surf Wiki (app.surf) — the open knowledge base
Elvis operator
In certain computer programming languages, the Elvis operator, often written ?:, is a binary operator that evaluates its first operand and returns it if its value is logically true (according to a language-dependent convention, in other words, a truthy value), and otherwise evaluates and returns its second operand. The second operand is only evaluated if it is to be returned (short-circuit evaluation). The notation of the Elvis operator was inspired by the ternary conditional operator, ? :, since the Elvis operator expression A ?: B is approximately equivalent to the ternary conditional expression A ? A : B.
Rendering article…
This content may have been generated or modified by AI, and may be sourced from third parties. CloudSurf Software LLC makes no warranties as to its accuracy, completeness, or reliability, and accepts no liability for it. Always verify important information against primary sources.
Report