Changes

Jump to navigation Jump to search
No change in size ,  15:52, 31 October 2018
no edit summary
==Ternary If==
The [https://en.wikipedia.org/wiki/%3F: ternary if] operator provides a short syntax for conditions. It is also called '''conditional operator''' or '''ternary operator'''. In most languages , the syntax is <code>a ? b : c</code>. As <code>?</code> and <code>:</code> have already been taken in XQuery, the syntax of Perl 6 is used:
<pre class="brush:xquery">
==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). 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">
</pre>
In general, if you have multiple of or nested if expressions, additional parentheses can improve the readibility of your code:
<pre class="brush:xquery">
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu