• 15 heures
  • Facile

Ce cours est visible gratuitement en ligne.

course.header.alt.is_video

course.header.alt.is_certifying

J'ai tout compris !

Mis à jour le 04/05/2022

Check what you've learned about program logic!

Connectez-vous ou inscrivez-vous gratuitement pour bénéficier de toutes les fonctionnalités de ce cours !

Compétences évaluées

  • Manage program logic in JavaScript (conditions, loops, and errors)
  • Question 1

    What is the value of  message at the end of this code snippet?

    let online = true;
    let message = '';
    if (online) {
    message = 'User online!';
    } else {
    message = 'User offline!';
    }
    • ''

    • 'User online!'

    • 'User offline!'

  • Question 2

    What is the value of  passengersBoarded  at the end of this code snippet?

    let passengersBoarded = 0;
    if (passengersBoarded <= 10) {
    passengersBoarded += 10;
    } else {
    passengersBoarded -= (passengersBoarded - 10);
    }
    • 0

    • -10

    • 10

  • Question 3

    What is the value of  passengersBoarded at the end of this code snippet?

    let passengersBoarded = 18;
    if (passengersBoarded <= 10) {
    passengersBoarded += 10;
    } else {
    passengersBoarded -= (passengersBoarded - 10);
    }
    • 10

    • 18

    • 0

    • 28