QP School
JavaScript - The find() method - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: JavaScript Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=6)
+--- Thread: JavaScript - The find() method (/showthread.php?tid=4084)



JavaScript - The find() method - Qomplainerz - 04-04-2023

Code:
const ages =
      [
        3,
        10,
        18,
        20
      ];

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

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