In the previous sample we learnt the simple method of using JavaScript lastindexof string function that accepts only 1 parameter as string type and returns the index of last occurrence of specified string pattern. In this sample we will pass one optional parameter to JavaScript lastindexof function as start index integer value that enables the function to start traversing the provided string from the specified index towards the left end of the provided string to find the specified string pattern.