intersectionWith method

Set<E> intersectionWith(
  1. Set<E> other
)

Returns a new set containing only the elements present in both sets.

Example:

{1, 2, 3}.intersectionWith({2, 3, 4}); // {2, 3}

Implementation

Set<E> intersectionWith(Set<E> other) => intersection(other);