Concatenates the contents of several arrays into a single array.
array:join( $arrays as array(*)*array(*)The function can be expressed as follows in XQuery:
declare function array:join($arrays as array(*)*) as array(*) {
if (fn:empty($arrays))
then []
else if (fn:count($arrays) eq 1)
then $arrays
else
op:array-concat(fn:head($arrays), array:join(fn:tail($arrays)))
};
The expression array:join(()) returns [ ].
The expression array:join([1, 2, 3]) returns [1, 2, 3].
The expression array:join((["a", "b"], ["c", "d"])) returns ["a", "b", "c", "d"].
The expression array:join((["a", "b"], ["c", "d"], [ ])) returns ["a", "b", "c", "d"].
The expression array:join((["a", "b"], ["c", "d"], [["e", "f"]])) returns ["a", "b", "c", "d", ["e", "f"]].