array find method javascript

JavaScript
function isBigEnough(element) {
  return element >= 15;
}

[12, 5, 8, 130, 44].find(isBigEnough); // 130 var ages = [3, 10, 18, 20];

function checkAdult(age) {
  return age >= 18;
}

function myFunction() {

    document.getElementById("demo").innerHTML = ages.find(checkAdult);
} 
Source

Also in JavaScript: