🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to JavaScript Notes
Topic #108

JS Error Object

The Error Object

JavaScript has a built in error object that provides error information when an error occurs.

The error object provides useful properties like name and message.

Error Object Methods & Properties

Property Description
new Error() Creates a new Error object
name Sets or returns an error name
message Sets or returns an error message
cause Sets or returns an error cause
Error.isError(x) Returns true if a value (x) is an Error

Error Names

Six different values can be returned by the error name property:

Error Name Description Try it
EvalError Deprecated - use SyntaxError instead
RangeError A number "out of range" has occurred
ReferenceError An illegal reference has occurred
SyntaxError A syntax error has occurred
TypeError A type error has occurred
URIError An error in encodeURI() has occurred

Warning: Non-Standard Properties and Methods In older JavaScript code you might find non-standard properties and methods. Do not use these properties and methods. They will not work in all browsers. PropertyDescription argumentsDeprecated callerDeprecated columnNumberFirefox only descriptionMicrosoft only displayNameFirefox only fileNameFirefox only lineNumberFirefox only numberMicrosoft only stackFirefox only MethodsDescription evalError()Deprecated internalError()Firefox only toSource()Non Standard


Note: See Also: JavaScript Errors JavaScript Silent Errors JavaScript Error Statemets JavaScript Debugging

Want to go beyond the notes?

Join CodingNow 2.0's JavaScript course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

JS Error Object – FAQs

Quick answers about learning JS Error Object in JavaScript.

This free note from CodingNow 2.0 explains JS Error Object in JavaScript — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every JavaScript topic on CodingNow 2.0, including JS Error Object, is 100% free with no signup required.
With focused practice, most students grasp JS Error Object in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now