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

# intersect(_:)

Removes from the receiving hash table each element that isn’t a member of another given hash table.

## Declaration

```swift
func intersect(_ other: NSHashTable<ObjectType>)
```

## Parameters

- `other`: The hash table with which to perform the intersection.

## Discussion

Discussion The equality test used for members depends on the personality option selected. For instance, choosing the objectPersonality option will use isEqual: to determine equality. See NSPointerFunctions.Options for more information on personality options and their corresponding equality tests.

## See Also

### Comparing Hash Tables

- [intersects(_:)](foundation/nshashtable/intersects(_:).md)
- [isSubset(of:)](foundation/nshashtable/issubset(of:).md)
- [isEqual(to:)](foundation/nshashtable/isequal(to:).md)
