JavaScript Find and FindIndex Method
Want to understand Properly Plz see the video carefully on YouTube channel name is Adisma
------------------------------------------------------------------------
Definition and Usage
The find()
method returns the value of the first element that passes a test.
The find()
method executes a function for each array element.
The find()
method returns undefined
if no elements are found.
The find()
method does not execute the function for empty elements.
The find()
method does not change the original array.
------------------------------------------------------------
The findIndex()
method executes a function for each array element.
The findIndex()
method returns the index (position) of the first element that passes a test.
The findIndex()
method returns -1 if no match is found.
The findIndex()
method does not execute the function for empty array elements.
The findIndex()
method does not change the original array.
Comments
Post a Comment