More than two roads
Exam grades aren't just pass or fail — there's A, B, C and more. When there are several choices, you can chain decisions together with else if.
else if
const marks = 72;
if (marks >= 80) {
console.log("Grade A");
} else if (marks >= 60) {
console.log("Grade B");
} else if (marks >= 40) {
console.log("Grade C");
} else {
console.log("Try again");
}JavaScript checks each condition from top to bottom and runs the first block whose condition is true. Everything after that is skipped.