DevPath · Learn to code ESPTEN

JavaScript

🔀 Conditionals

Give your program the power to decide with if/else, the ternary operator and switch: the first step toward something that feels smart.

What you'll learn

Lessons

if, else if and elseGive your program the power to decide: run code only when a condition is met. Truthy/falsy and the ternary operatorWhich values count as true and how to resolve an if in a single line. The switch structureCompare a variable against many fixed values.
Practice this module in the app

DevPath is a hands-on course: you read the theory here; in the app you put it into practice with exercises that really run, offline.

Start free in the app →