Changes

Jump to navigation Jump to search
77 bytes added ,  15:54, 31 October 2018
no edit summary
==Elvis Operator==
The Elvis operator is also available in other languages. It is sometimes called [https://en.wikipedia.org/wiki/Null_coalescing_operator null-coalescing operator]. In XQuery, the value of the first operand will be returned if it is a non-empty sequence. Otherwise, the value of the second operand will be returned. It is equivalent to the {{Function|Utility|util:or}} function:
<pre class="brush:xquery">
(: if/then/else :)
if (exists($number)) then $number else 0,
(: function call :)
util:or($number, 0),
(: elvis operator :)
$number ?: 0
)
</pre>
 
The behavior of the operator is equivalent to the {{Function|Utility|util:or}} function.
==If Without Else==
)
</pre>
 
The behavior of the if expression is equivalent to the {{Function|Utility|util:if}} function.
=Functions=
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu