O'Reilly logo

JavaScript Pocket Reference, 2nd Edition by David Flanagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Error

Constructor

new Error(message)
new EvalError(message)
new RangeError(message)
new ReferenceError(message)
new SyntaxError(message)
new TypeError(message)
new URIError(message)

These constructors create an instance of the Error class or of one of its subclasses. The message argument is optional.

Properties

Error and all of its subclasses define the same two properties:

message

An error message that provides details about the exception. This property holds the string passed to the constructor, or an implementation-defined default string.

name

A string that specifies the type of the exception. This property is always the name of the constructor used to create the exception object.

Methods

toString( )

Returns a string representation of the Error (or subclass) object.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required