ArrayUtil - union(Array a, Array b)

Merge two or more arrays.

Any number of arrays can be provided as parameters.

Table 1. Parameters
Name Type Description
a Array An array
b Array An array
Table 2. Returns
Type Description
Array An array of items from all the input arrays. Duplicates are removed.

var arrayUtil = new ArrayUtil();
var a1 = new Array("a", "b", "c");
var a2 = new Array("c", "d", "e");
gs.print(arrayUtil.union(a1, a2));

Output: a,b,c,d,e