<html>
<body>
<h1>JavaScript Arrays</h1>
<h2>The every() Method</h2>
<p>The every() method returns true if every element in an array pass a function test.</p>
<p id="demo"></p>
<script>
// Create an Array
const ages = [32, 33, 16, 40];
// Function to Run for every Element
function checkAge(age) {
return age > 18;
}
document.getElementById("demo").innerHTML = "Is every element over 18? " + ages.every(checkAge);
</script>
</body>
</html>