JS Coding Questions Logo
JS Coding Questions
#78🎯 Exercise💻 Code

JavaScript Coding Exercise 78

Advertisement

728x90
javascript
1try {
2
3setTimeout(() => {
4
5console.log("try block");
6
7throw new Error(`An exception is thrown`);
8}, 1000);
9} catch (err) {
10
11console.log("Error: ", err);
12}

Choose the correct output:

A
try block, Error: An exception is thrown
B
Error: An exception is thrown
C
try block, Uncaught Error: Exception is thrown
D
Uncaught Error: Exception is thrown

Advertisement

Responsive Ad
78of86