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

Course Content

Introduction to JavaScript

Introduction to JavaScript

1. Getting Started
2. Manipulating Data
3. Conditional Statements

book
Task - Checking Age Eligibility

Task

Swipe to start coding

In this task you will write a small JavaScript program that checks if a person is old enough to drive.

  • Create a variable age and assign it a random number (e.g., 18).
  • 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.
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
toggle bottom row

book
Task - Checking Age Eligibility

Task

Swipe to start coding

In this task you will write a small JavaScript program that checks if a person is old enough to drive.

  • Create a variable age and assign it a random number (e.g., 18).
  • 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.
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