QP School

Full Version: JavaScript Array every() example
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
const ages =
      [
        32,
        33,
        16,
        40
      ];

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

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