#control-flow
Conditionals
Conditionals let your code make decisions. Instead of running every line top to bottom, you can branch — execute different code depending on whether something is true or false. This is fundamental to every program you’ll ever write. if Statements The simplest conditional: run code only if a condition is true. const temperature = 35; if (temperature > 30) { console.log("It's hot outside!"); } if…else Handle both cases: const age = 17; if (age >= 18) { console. Read more →
May 18, 2026