109
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
Output:
-1
Example 2
JavaScript TypedArray indexOf() Method
Output:
4
Next TopicJavaScript TypedArray Object