find() method returns the value of the first element that passes test from provided function.
syntax ↴
find(callbackFn) A function to execute for each element in the array ↴
function is called with the following arguments ↴
find(function(element, index, array), thisArg) ↴
callback function allows access to each element, the index, and the original array itself.
thisArg (optional). Value to use as this when executing callbackFn. By default, it is undefined.
find() method returns the value of the first element that passes the test from provided function.
find() method returns undefined if no elements pass test from provided function.
find() method does not execute the function for empty array elements.
find() method does not change the original array.
findIndex() method returns the first index that satisfies the testing function (rather than the first element).
myArray.find(callbackFn)