Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JavaScript - The find() method
#1
Code:
const ages =
      [
        3,
        10,
        18,
        20
      ];

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

document.getElementById("demo").innerHTML = ages.find(checkAge);
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  JavaScript - Array find() example (returns the value) Qomplainerz 0 419 04-04-2023, 08:12 AM
Last Post: Qomplainerz
  JavaScript Array fill() method examples Qomplainerz 0 318 04-04-2023, 07:41 AM
Last Post: Qomplainerz
  JavaScript - The filter() method Qomplainerz 0 280 04-04-2023, 07:41 AM
Last Post: Qomplainerz
  Find the min, max and avg of two numbers in JavaScript Qomplainerz 0 261 04-04-2023, 07:38 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 3 Guest(s)