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

Contenu du cours

Introduction to JavaScript

Introduction to JavaScript

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

book
Task - Checking Age Eligibility

Tâche

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 desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
toggle bottom row

book
Task - Checking Age Eligibility

Tâche

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 desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt