ArrayUtil - unique(Array a)

Removes duplicate items from an array.

Table 1. Parameters
Name Type Description
a Array The array to check for duplicate elements.
Table 2. Returns
Type Description
Array An array of unique items from the input array.

var arrayUtil = new ArrayUtil();
var a1 = new Array("a", "b", "c", "c", "b");
gs.print(arrayUtil.unique(a1));

Output: a,c,b