---
title: "isEqual(to:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsset/isequal(to:)"
---

# isEqual(to:)

Compares the receiving set to another set.

## Declaration

```swift
func isEqual(to otherSet: Set<AnyHashable>) -> Bool
```

## Parameters

- `otherSet`: The set with which to compare the receiving set.

## Return Value

Return Value true if the contents of otherSet are equal to the contents of the receiving set, otherwise false.

## Discussion

Discussion Two sets have equal contents if they each have the same number of members and if each member of one set is present in the other. Object equality is tested using isEqual:.

## See Also

### Related Documentation

- [isEqual(_:)](objectivec/nsobjectprotocol/isequal(_:).md)

### Comparing Sets

- [isSubset(of:)](foundation/nsset/issubset(of:).md)
- [intersects(_:)](foundation/nsset/intersects(_:).md)
- [value(forKey:)](foundation/nsset/value(forkey:).md)
- [setValue(_:forKey:)](foundation/nsset/setvalue(_:forkey:).md)
