Javatpoint Logo
Javatpoint Logo

JavaScript TypedArray lastIndexOf() Method

The JavaScript lastIndex()of method returns the last position of a value, or it returns -1 if the value is not found.

NOTE: The string is searched from the end to the beginning, but returns the index starting from the beginning, at position 0.

The lastIndexof() method is case sensitive.



Value: The first parameter is value that is going to be searched in the array.

Start: It refers the position where to start the search. If the value is not given in the argument, the default value is the length of the array.

Return value:

Representing the index of the element where the value is found for the last time, or -1 if the value cannot be found.

Browser Support:

Chrome Yes
Safari Yes
Firefox Yes


JavaScript lastIndexOf() Method

Test it Now



Example 2

JavaScript lastIndexOf() Method

Test it Now



Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA