Javascript: Error Object

By Xah Lee. Date:

2015-08-13 this page is work in progress.

JavaScript error object, is typically use with the “throw” statement. [see JS: Throw Try Catch Finally]

ECMAScript 2015 §Fundamental Objects#sec-error-objects



Error(message)message is a optional message for information purposes.

new Error(…) → same as Error(…).


message → value is from the argument when Error(...) is called. If none given, it's supplied by browser.

name → a name for the error.

ECMAScript 2015 §Fundamental Objects#sec-native-error-types-used-in-this-standard

ECMAScript 5.1 §4

Liket it? I spend 2 years writing this tutorial. Help me spread it. Tell your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.