Register - Login - Forgotten Password

Lesson 4: Making Decisions with if, else and switch in JavaScript

Will the assignment happen, or will JavaScript skip it? In `let result; let score = 82; if (score >= 70) { result = "Pass"; }`, the assignment happens because `82 >= 70` evaluates to the truthy Boolean value `true`. This small route through the code introduces control flow: the order and path followed as JavaScript executes statements. A condition can allow one block to run while another route is skipped.

Lesson 4: Making Decisions with if, else and switch in JavaScript

This lesson just one in the category Introduction to JavaScript. To access this lesson you need to have a valid learner account, ask your parent to register you now.