Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Checking Age Eligibility | Conditional Statements
Introduction to JavaScript

Swipe to show menu

book
Challenge: Checking Age Eligibility

Task

Swipe to start coding

Write a program that checks if a person is old enough to drive.

Write a console.log statement which outputs:

  • "The user is old enough to drive: true" if age is 18 or older.
  • "The user is old enough to drive: false" if age is less than 18.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 2
We're sorry to hear that something went wrong. What happened?

Ask AI

expand
ChatGPT

Ask anything or try one of the suggested questions to begin our chat

book
Challenge: Checking Age Eligibility

Task

Swipe to start coding

Write a program that checks if a person is old enough to drive.

Write a console.log statement which outputs:

  • "The user is old enough to drive: true" if age is 18 or older.
  • "The user is old enough to drive: false" if age is less than 18.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 2
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt