Changes

Jump to navigation Jump to search
737 bytes added ,  11:00, 21 November 2023
Added array:members
* <code>array:join((["a", "b"], ["c", "d"], [ ]))</code> returns the array {{Code|["a", "b", "c", "d"]}}.
* <code>array:join((["a", "b"], ["c", "d"], [["e", "f"]]))</code> returns the array {{Code|["a", "b", "c", "d", ["e", "f"]]}}.
|}
 
==array:members==
 
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:members(
$array as array(*)
) as record(value as item()*)*
</pre>
|- valign="top"
| '''Summary'''
| Delivers the contents of an {{Code|$array}} as a sequence of value records.
|- valign="top"
| '''Examples'''
|
<ul>
<li><code>array:members([])</code> returns {{Code|()}}.</li>
<li><code>array:members([1 to 5])?value</code> returns {{Code|(1, 2, 3, 4, 5)}}.</li>
<li><code>array:members([(1,1), (2,4), (3,9), (4,16), (5,25)]) ! sum(?value)</code> returns {{Code|(2, 6, 12, 20, 30)}}.</li>
<li><pre>let $array := [ "any array" ]
return deep-equal(
$array,
array:of-members(array:members($array))
)</pre> returns {{Code|true()}}</li>
</ul>
|}
administrator, Bureaucrats, editor, reviewer, Administrators
57

edits

Navigation menu