Javascript — Conditional Statements
Conditional statements let your code make decisions by running different code blocks based on true or false conditions. The 'if', 'else if', and 'else' blocks allow multiple pathways. The switch statement provides an efficient way to select among many exact matches.
let score = 85;
if (score > 90) {
console.log("Excellent!");
} else if (score > 70) {
console.log("Good job!");
} else {
console.log("Keep practicing!");
}