<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSHashTable/intersect(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSHashTable(im)intersectHashTable:"
  },
  "title" : "intersect(_:)"
}
-->

# intersect(_:)

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

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

## Parameters

`other`

The hash table with which to perform the intersection.

## Discussion

The equality test used for members depends on the personality option selected. For instance, choosing the [`objectPersonality`](/documentation/Foundation/NSPointerFunctions/Options/objectPersonality) option will use `isEqual:` to determine equality. See [`NSPointerFunctions.Options`](/documentation/Foundation/NSPointerFunctions/Options) for more information on personality options and their corresponding equality tests.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)