In JavaScript, the find() method returns the value of the first element in the array that meets the criteria, or undefined if it does not. Such as:
Const arr =,4,25,57,100 [2]; const a = arr.find(item=>item>50); console.log(a) //a=57Copy the code
Note: 1. The find method does not alter the array. 2. Extension: findIndex() returns the index position of the element that matches the criteria.