<!--
{
  "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/isEqual(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSHashTable(im)isEqualToHashTable:"
  },
  "title" : "isEqual(to:)"
}
-->

# isEqual(to:)

Returns a Boolean value that indicates whether a given hash table is equal to the receiving hash table.

```
func isEqual(to other: NSHashTable<ObjectType>) -> Bool
```

## Parameters

`other`

The hash table with which to compare the receiving hash table.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the contents of `other` are equal to the contents of the receiving hash table, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Two hash tables have equal contents if they each have the same number of members and if each member of one hash table is present in the other.

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)