Conditions allow your program to make decisions. JavaScript uses if and else statements to control the flow of logic.
let score = 70;
if (score >= 50) {
document.write("You passed");
} else {
document.write("You failed");
}
Conditions are used everywhere — login systems, forms, dashboards, and real applications.