<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMutableArray/removeObjects(in:)-4yb26",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMutableArray(im)removeObjectsInArray:"
  },
  "title" : "removeObjects(in:)"
}
-->

# removeObjects(in:)

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

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

## Parameters

`otherArray`

An array containing the objects to be removed from the receiving array.

## Discussion

This method is similar to [`remove(_:)`](/documentation/Foundation/NSMutableArray/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:`.

---

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)