Returns the index of the last occurrence of a substring in the string.
lastIndexOf(substring, startIndex?)
substring
The substring to search for.
startIndex optional
The index at which to begin searching. If omitted, the search begins at the end of the string.
The index of the last occurrence of the specified substring, or -1 if not found.
"banana".indexOf("na")
4
"banana".indexOf("no")
-1