String lastIndexOf() Return value
This method returns the index of the string (0-based) where the searchvalue is found for the last time. If the searchvalue cannot be found in the string then the method returns -1
JavaScript String lastIndexOf() Method
The lastIndexOf()
method in JavaScript is used to search for the last occurrence of a specified substring within a string.
It returns the index of the last occurrence of the specified substring, or -1 if the substring is not found.
Contact Us