---
title: "intersect(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutableset/intersect(_:)"
---

# intersect(_:)

Removes from the receiving set each object that isn’t a member of another given set.

## Declaration

```swift
func intersect(_ otherSet: Set<AnyHashable>)
```

## Parameters

- `otherSet`: The set with which to perform the intersection.

## See Also

### Related Documentation

- [remove(_:)](foundation/nsmutableset/remove(_:).md)
- [removeAllObjects()](foundation/nsmutableset/removeallobjects().md)

### Combining and recombining sets

- [union(_:)](foundation/nsmutableset/union(_:).md)
- [minus(_:)](foundation/nsmutableset/minus(_:).md)
- [setSet(_:)](foundation/nsmutableset/setset(_:).md)
