

It returns undefined if no elements are found. find() – returns the first element that satisfies the specified boolean function.


const marks = Ĭonsole.log( marks.filter(checkPass) ) //Ĭonsole.log( marks.find(checkPass) ) //90Ĭonsole.log( marks.findIndex(checkPass) ) //0Ĭonsole.log( marks.some(checkPass) ) //true In this tutorial, we will go through each method separately and understand its usage with an example. We can use these methods in TypeScript as well. JavaScript provides various methods to find elements in the array.
