sed view of the array of numbers. Next, the function calls the
array&#39;s <code>index(before:)</code> method to return the correct position in the
passed array.</p>

<pre><code class="language-swift">func indexOfLastEven(_ numbers: [Int]) -&gt; 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 = ind