Home » JavaScript TypedArray indexOf() Method

JavaScript TypedArray indexOf() Method

by Online Tutorials Library

JavaScript TypedArray indexOf() Method

The JavaScript indexof() Method is used to find the index of the element provided as the argument to the function.

  • The indexof() method is case sensitive.

Syntax:

Parameters:

Value: Value to be search in the index.

Start: Default 0. At which position to start the search.

Return value:

It returns the index of the search element. If the element cannot to be found in the array, this method returns -1.

Browser Support:

Chrome Yes
Edge Yes
Firefox Yes
Opera Yes

Example 1

JavaScript TypedArray indexOf() Method

Test it Now

Output:

-1  

Example 2

JavaScript TypedArray indexOf() Method

Test it Now

Output:

4  

You may also like