Introduction to Array.find
Premium
You learned how to write search loops by hand in the loops series. This lesson shows the built-in shortcut: Array.find(). Pass it a function that returns true for the element you want, and it returns that element (or undefined if nothing matches).