Skip to content

Instantly share code, notes, and snippets.

@Chuloo
Last active February 6, 2019 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chuloo/8152e3ad8f6f952b14caad1e931b167f to your computer and use it in GitHub Desktop.
Save Chuloo/8152e3ad8f6f952b14caad1e931b167f to your computer and use it in GitHub Desktop.
Test for users that can drive
// Age of users
const ages = [17, 18, 22, 25];
// Age threshold to drive
const drivingAge = 16;
// Test users for who can drive
let canDrive = ages.every(function(age){return age >= drivingAge;});
console.log(canDrive)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment