name  Error  instance property JS Home  <<  JS Reference  <<  Error  <<  name

Description

Contains a name for an error.

Syntax

Signature Description
anError.nameContains a name for an error.

Parameters

None.

Examples

The code below displays the name property of the Error object.


var anError = new Error();

anError.name = 'errorName';

alert('Error Name is: ' + anError.name);

Press the button below to action the above code:

Related Tutorials

JavaScript Advanced Tutorials - Lesson 2 - Errors