findLastIndex(predicate: (Element) -> Bool) -> Int?

This method is like .findIndex except it iterates over the elements of array from right to left.

Parameters

  • predicate: The function invoked per iteration.

Returns

Returns the index of the found element, else nil.

[1,2,3,4,5].findLastIndex{$0 % 2 == 0}
// -> 3