Determine the initial and final positions of an item within a list.
import
public |
The lastIndexOf() method retrieves the position of the last occurrence of a value within the list. If the item isn’t present, it returns -1.
public |
Parameter |
Description |
item |
Necessary. The item being sought within the list. |
Returns: |
The index of the last occurrence of the item in the list, or -1 if the item is not present. |