---
title: "index(of:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/set/index(of:)"
---

# index(of:)

Returns the first index where the specified value appears in the collection.

## Declaration

```swift
func index(of element: Self.Element) -> Self.Index?
```

## See Also

### Finding Elements

- [subscript(_:)](swift/set/subscript(_:).md)
- [contains(where:)](swift/set/contains(where:).md)
- [allSatisfy(_:)](swift/set/allsatisfy(_:).md)
- [first(where:)](swift/set/first(where:).md)
- [firstIndex(of:)](swift/set/firstindex(of:).md)
- [firstIndex(where:)](swift/set/firstindex(where:).md)
- [min()](swift/set/min().md)
- [min(by:)](swift/set/min(by:).md)
- [max()](swift/set/max().md)
- [max(by:)](swift/set/max(by:).md)
