<!--
{
  "documentType" : "article",
  "framework" : "AppStoreConnectAPI",
  "identifier" : "/documentation/AppStoreConnectAPI/intersecting-sets",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Intersecting sets"
}
-->

# Intersecting sets

Return the intersection of two or more arrays treated as sets.

## Discussion

Use the `intersection()` function in the expression of a matchmaking rule to find the common items in arrays. For example, intersection `([[ ‘a’, ‘b’ ], [ ‘b’, ‘c’ ], [ ‘b’, ‘d’]])` returns `[ ‘b’ ]`.

### Declaration

```other
array intersection(array[array[any]] $sets)
```

### Parameters

-`sets`: An array of arrays that the function converts to sets and then intersects with each other.

### Return value

A set that’s the intersect of the set representation of the arrays in `sets`.

---

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)