← Quiz: Error Handling and Debugging: all 10 questions
Quiz: Error Handling and Debugging · Question 1 of 10
What does this print? (code)
What does this print?
try {
console.log("A");
null.x;
console.log("B");
} catch (e) {
console.log("C");
} finally {
console.log("D");
}
- A.A B C D
- B.A C D
- C.A B D
- D.C D
Answer & explanation
Correct answer: A C D
The error on null.x skips "B"; catch prints C and finally always prints D. The printed lines are A, C, D.
Can you get the rest right without peeking?
Take the timed Quiz: Error Handling and Debugging quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →