javascript findany code example
Example 1: js some
movies.some(movie => movie.year > 2015)
// Say true if in movie.year only one (or more) items are greater than 2015
// Say false if no items have the requirement (like and operator)
Example 2: object find javascript
function isBigEnough(element) {
return element >= 15;
}
[12, 5, 8, 130, 44].find(isBigEnough); // 130