---
title: "firstIndex(of:)"
framework: paperkit
role: symbol
role_heading: Instance Method
path: "paperkit/markuporderedset/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.

## Declaration

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

## Discussion

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

## See Also

### Finding elements

- [contains(_:)](paperkit/markuporderedset/contains(_:).md)
