This documentation is archived and is not being maintained.
number Property
Visual Studio 2010
Returns or sets the numeric value associated with a specific error.
object.number
The following example causes an exception to be thrown and displays the error code that is derived from the error number.
try
{
var arr = new Array(-1);
}
catch(e)
{
print ("Error Code: " + (e.number & 0xFFFF));
print ("Facility Code: " + (e.number>>16 & 0x1FFF));
print ("Error Message: " + e.message);
print ("Error Name: " + e.name);
}
The output of this code is as follows.
Error Code: 5029 Facility Code: 10 Error Message: Array length must be zero or a positive integer Error Name: RangeError
Show: