$.array.setOperations
Set operations (Union, Intersection, Complement, Difference)
Last updated
Set operations (Union, Intersection, Complement, Difference)
Last updated
You may want to unite between 2 or more arrays uniquely, this is why we provide helper for that. Actually, you can use spread operator to do all of that[...Array1, ...Array2, ...ArrayN]
, but this way will allow duplication of data and not unique.
If you do manually you only can do intersection for just 2 arrays, but our helper can intersect multiple arrays at once.
Complement also known as difference, the complement here is to remove only the first array by the same items from other arrays, we make this helper can accept multiple arrays or more than 2 arrays here.
Difference better known as symmetric difference, here we provide a helper for removing all the same items or elements of multiple arrays and return it as a new single array.