public intersection(other as HashSet<T>) as HashSet<T>:
Returns a new set containing elements present in both sets.
| Parameter | Description |
|---|---|
other | Elements to test against. |
A new hash set containing the intersection.
import klyn.collections
common = {1, 2, 3}.intersection({2, 3, 4})
assert common.size == 2
assert 2 in common