<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/ReversedCollection/Index/base",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s18ReversedCollectionV5IndexV4baseACQzvp"
  },
  "title" : "base"
}
-->

# base

The position after this position in the underlying collection.

```
let base: Base.Index
```

## Discussion

To find the position that corresponds with this index in the original,
underlying collection, use that collection’s `index(before:)` method
with the `base` property.

The following example declares a function that returns the index of the
last even number in the passed array, if one is found. First, the
function finds the position of the last even number as a `ReversedIndex`
in a reversed view of the array of numbers. Next, the function calls the
array’s `index(before:)` method to return the correct position in the
passed array.

```
func indexOfLastEven(_ numbers: [Int]) -> Int? {
    let reversedNumbers = numbers.reversed()
    guard let i = reversedNumbers.firstIndex(where: { $0 % 2 == 0 })
        else { return nil }

    return numbers.index(before: i.base)
}

let numbers = [10, 20, 13, 19, 30, 52, 17, 40, 51]
if let lastEven = indexOfLastEven(numbers) {
    print("Last even number: \(numbers[lastEven])")
}
// Prints "Last even number: 40"
```

---

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)