NAME

union - return the union of elements in two arrays

SYNOPSIS

arr1.union(arr2)

DESCRIPTION

The union() method returns a vector containing all unique elements from both arr1 and arr2. Duplicate elements are only included once. This is similar to APL vec arr.

RETURN VALUE

A vector containing the unique elements from both input arrays.

ERRORS

ArgCheck if exactly one argument is not provided.

EXAMPLE

    a = [1, 2, 3]
    b = [3, 4, 5]
    a.union(b)
[1, 2, 3, 4, 5]

SEE ALSO

unique
intersect
without