QP School

Full Version: JavaScript - The find() method
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
const ages =
      [
        3,
        10,
        18,
        20
      ];

function checkAge(ages)
{
  return ages > 18;
}

document.getElementById("demo").innerHTML = ages.find(checkAge);