Skip to main content

Pair.last_index_of

last_index_ofelementstart

Group: Values

Documentation

Returns the last index of an element in the pair. Returns Nothing if the element is not found.

Arguments

  • element: The element to search for or a predicate function to test for each element.
  • start: The index to start searching backwards from. If the index is negative, it is counted from the end of the pair.

Examples

Find the last index of an element in a pair.

      Pair.new 2 2 . last_index_of 2 == 1