Array.prototype.find()
The
find()
method returns the first element in the provided array that satisfies the provided testing function.
If no values satisfy the testing function,
undefined
is returned.
findIndex()
.
indexOf()
.
(It's similar to
findIndex()
, but checks each element for equality with the value instead of using a testing function.)
If you need to find if a value
exists
in an array, use
includes()
.
Again, it checks each element for equality with the value instead of using a testing function.
some()
.