Error.name (Property)

The name of an Error object can be accessed with this property.

Availability:

ECMAScript edition - 3
JavaScript - 1.5
JScript - 5.5
Internet Explorer - 5.5
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myError.name
-myError.name = aString
Argument list:aStringThe new name value for the Error object

The initial value for this property is the string primitive "Error". The ECMA standard suggests that this property can be assigned with a different name for each instance of the Error object.

For native errors that are subclassed from this Error object, the name property will be the name of that object class and will be one of the following:

Cross-references:

ECMA 262 edition 3 - section - 15.11.4.2