ArrayUtil - diff(Array a, Array b)

Finds the differences between 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 Returns an array of items from array a that were not found in either array b or c, or other input arrays. Duplicates are removed from the result.

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

Output: a,b