Conditions (if / else)
Decision making with if-else, comparisons, logical operators, and the ternary operator (? :).
Simple enough for a 5-year-old to understand
if / else
The condition is written inside parentheses, and the code to execute is inside curly braces { }.
const score = 75;if (score >= 50) { console.log("Passed");} else { console.log("Failed");}🎯 Exercise & Practice
Test what you've learned — answer, write code, check instantly. (1 left)