MCQ
In JavaScript, what is the purpose of the else part of an if-else statement?
Unit-3 Programming Fundamentals
A It runs when the condition is true
B It runs when the condition is false
C It runs before the if block
D It always runs
Explanation

The else block executes only when the if condition evaluates to false.