BoxSetIntersection
Compute the intersection (A \u2229 B) of two Sets, returning a new Set that contains only the elements present in both A and B.
The result is a new Set of the same variant as A; neither input is modified.
Method Signature
BoxSetIntersection(set=[set], otherSet=[any])Arguments
Argument
Type
Required
Description
Default
set
set
true
The first set (A).
otherSet
any
true
The second set (B). Accepts any value castable to a Set.
Examples
Return elements common to both Sets
a = [ 1, 2, 3 ].toSet();
b = [ 3, 4, 5 ].toSet();
i = a.intersection( b );
writeOutput( i.size() );
Result: 1
Using the * operator shorthand
Result: 2
Related
Last updated
Was this helpful?
