The Universal Standard

Easy+15 XP

Mission Briefing

The bouncer at the club must verify that every single person in the group is old enough to enter! If even one person is underage, the entire group is denied.

The Concept: Does 'Every' Match?

The .every() method tests whether all elements in the array pass the provided test function. It returns a boolean. Example: [10, 20, 30].every(x => x > 5); // true

The Objective

Your function receives an array ages.

  1. Use the .every() method.
  2. Return true if all ages are 18 or older, otherwise false.

01EXAMPLE 1

Inputages = [20, 25, 30]
Outputtrue

Constraints

  • Use the .every() method.
CoreArrays
JavaScript
Loading...
3 Hidden

Input Arguments

ages[20,25,30]

Expected Output

true

Click RUN to test your solution