---
title: "removeObjects(in:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutablearray/removeobjects(in:)-4yb26"
---

# removeObjects(in:)

Removes from the receiving array the objects in another given array.

## Declaration

```swift
func removeObjects(in otherArray: [Any])
```

## Parameters

- `otherArray`: An array containing the objects to be removed from the receiving array.

## Discussion

Discussion This method is similar to remove(_:), but it allows you to efficiently remove large sets of objects with a single operation. If the receiving array does not contain objects in otherArray, the method has no effect (although it does incur the overhead of searching the contents). This method assumes that all elements in otherArray respond to hash and isEqual:.

## See Also

### Removing Objects

- [removeAllObjects()](foundation/nsmutablearray/removeallobjects().md)
- [removeLastObject()](foundation/nsmutablearray/removelastobject().md)
- [remove(_:)](foundation/nsmutablearray/remove(_:).md)
- [remove(_:in:)](foundation/nsmutablearray/remove(_:in:).md)
- [removeObject(at:)](foundation/nsmutablearray/removeobject(at:).md)
- [removeObjects(at:)](foundation/nsmutablearray/removeobjects(at:).md)
- [removeObject(identicalTo:)](foundation/nsmutablearray/removeobject(identicalto:).md)
- [removeObject(identicalTo:in:)](foundation/nsmutablearray/removeobject(identicalto:in:).md)
- [removeObjects(fromIndices:numIndices:)](foundation/nsmutablearray/removeobjects(fromindices:numindices:).md)
- [removeObjects(in:)](foundation/nsmutablearray/removeobjects(in:)-1udmn.md)
