<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PaperKit",
  "identifier" : "/documentation/PaperKit/MarkupOrderedSet/firstIndex(of:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PaperKit"
    ],
    "preciseIdentifier" : "s:8PaperKit16MarkupOrderedSetV10firstIndex2ofSiSgAA0C0_p_tF"
  },
  "title" : "firstIndex(of:)"
}
-->

# firstIndex(of:)

Returns the index of the given element in the set, or `nil` if the element is not a member
of the set.

```
func firstIndex(of element: MarkupOrderedSet.Element) -> Int?
```

## Discussion

`MarkupOrderedSet` members are always unique, so the first index of an element is always the
same as its last index.

---

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)