I am confused between the difference between the two function indexOf and find Index in an array.

The documentation says

findIndex – Returns the index of the first element in the array where
predicate is true, and -1 otherwise.

and

indexOf – Returns the index of the first occurrence of a value in an
array.

8 Answers
8

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *