UNION

Takes two arrays, treated as sets (i.e. ignoring duplicate values), and returns a new array that contains all distinct items from both inputs.

Syntax

=UNION(array1, array2)

Examples

=UNION([1, 2, 3], [3, 4, 5])[1, 2, 3, 4, 5]
=UNION(["A", "B"], [1, 2])["A", "B", 1, 2]
=UNION([OBJECT("A", 1), OBJECT("B", 1)], [OBJECT("A", 1), OBJECT("C", 2)])[{"A": 1}, {"B": 1}, {"C": 2}]