FrontendDeveloper.in

JavaScript question detail

What is an error object

An error object is a built in error object that provides error information when an error occurs. It has two properties: name and message. For example, the below function logs error details,

try {
greeting("Welcome");
} catch (err) {
console.log(err.name + "
" + err.message);
}
Back to all JavaScript questions
Get LinkedIn Premium at Rs 399