← GrammarVit
🔀

The Logic Playground

Mastering Conditionals in Plain English

👋 Welcome to the Decision Factory!

Computer programs are essentially giant decision-making machines. Conditionals are the instructions that tell the computer "If this happens, do that. Otherwise, do something else." Use the tabs above to explore the different ways computers think.

The "If" Statement

Think of an if statement like a Club Bouncer.

The bouncer checks your ID. IF you are old enough (True), you get in. ELSE (False), you stay outside.

  • Condition: The question being asked (e.g., "Age >= 18?").
  • 🏃 Action: What happens if the answer is Yes.
  • 🛑 Else: The fallback plan if the answer is No.
if (age >= 18) {
  console.log("Welcome to the party! 🎉");
} else {
  console.log("Sorry, kiddo. 🍼");
}

🚪 The Digital Bouncer

Outcome Probability

Visualizing the binary nature of a simple IF/ELSE