Array.prototype.find makes finding items in arrays easier
takes a compare function
returns the first value found
returns undefined when nothing was found
combined with destructuring complex compares become short
Related Katas
Array API
array.sort()basicsarray.sort()can take a compare functionarray.shift()(as introduced in ES3)array.push()(as introduced in ES3)Array.from()Array.of()array.fill()array.find()array.findIndex()array.entries()array.keys()array.values()array.includes()array.toReversed()
Difficulty Level
TBD
First Published
29 April 2015
Stats
4 tests to solve