Javascript LastIndexOf() Function

The join() function of array object will returns the last index of an element within the array equal to the specified value, or -1 if none is found. Use it for example to start searching backwards.

Syntax

Javascript LastIndexOf() Function Example1

This will produce following result

Javascript LastIndexOf() Function Example2

This will produce following result