Arrays union intersection and difference

suggest change
x = [5, 5, 1, 3]
y = [5, 2, 4, 3]

Union (|) contains elements from both arrays, with duplicates removed:

x | y
=> [5, 1, 3, 2, 4]

Intersection (&) contains elements which are present both in first and second array:

x & y
=> [5, 3]

Difference (\-) contains elements which are present in first array and not present in second array:

x - y
=> [1]

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents