JavaScript TypedArray findIndex() MethodThe JavaScript findIndex() method provides the index of the first element in the array that completes the given test. If the test is not satisfied, it will return -1.
Syntax:Parameters:Value: The value of the current element. Index: The array index of the current element. Arr: The array object on which the findIndex() method operated. ThisValue: A value to be passed to the function to be used as its "this" value. If the parameter is empty, the value "undefined" will be passed as its "this" value. Return value:Index of the array element, otherwise it returns -1. Browser Support:
Example 1JavaScript TypedArray findIndex() Method Test it NowOutput: -1 Example 2JavaScript TypedArray findIndex() Method Test it NowOutput: 5
Next TopicJavaScript TypedArray Object
|