JavaScript | Error Handling and Debugging | Question 4

Last Updated :
Discuss
Comments

What is the output of the following code?

JavaScript
try {
    console.log(a);
} catch (e) {
    console.log(e.message);
}


a is not defined

ReferenceError: a is not defined

Undefined

Throws no error

Share your thoughts in the comments