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

# index(before:)

A value less than or equal to the number of elements in the collection.

## Declaration

```swift
func index(before i: LazyMapSequence<Base, Element>.Index) -> LazyMapSequence<Base, Element>.Index
```

## Discussion

Discussion note: O(1) if the collection conforms to RandomAccessCollection; otherwise, O(n), where n is the length of the collection.
