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

# union(_:)

Adds each element in another given hash table to the receiving hash table, if not present.

## Declaration

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

## Parameters

- `other`: The hash table of elements to add to the receiving hash table.

## 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

### Set Functions

- [minus(_:)](foundation/nshashtable/minus(_:).md)
