array.filter in javascript not working in w3schools

JavaScript
 var ages = [32, 33, 16, 40];

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

 
function myFunction() {
  document.getElementById("demo").innerHTML = ages.filter(checkAdult);
} 
Source

Also in JavaScript: