Identifies the base type of array elements
One or more arrays to combine
A new array containing all unique elements from all arrays
arrUnion([1, 2], [2, 3]); // [1, 2, 3]
arrUnion([1, 2], [3, 4], [4, 5]); // [1, 2, 3, 4, 5]
arrUnion(["a", "b"], ["b", "c"]); // ["a", "b", "c"]
arrUnion([1, 1, 2], [2, 2, 3]); // [1, 2, 3]
arrUnion([], [1, 2]); // [1, 2]
// Array-like objects
arrUnion({ length: 2, 0: 1, 1: 2 }, [2, 3]); // [1, 2, 3]
The arrUnion() method returns a new array containing all unique elements from all provided arrays. Uses strict equality (===) for comparison and maintains insertion order.