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

# isEqual(to:)

Compares the receiving array to another array.

## Declaration

```swift
func isEqual(to otherArray: [Any]) -> Bool
```

## Parameters

- `otherArray`: An array.

## Return Value

Return Value true if the contents of otherArray are equal to the contents of the receiving array, otherwise false.

## Discussion

Discussion Two arrays have equal contents if they each hold the same number of objects and objects at a given index in each array satisfy the isEqual(_:) test.

## See Also

### Comparing Arrays

- [firstObjectCommon(with:)](foundation/nsarray/firstobjectcommon(with:).md)
