Error() (Function)

An Error object constructor.


ECMAScript edition - 3
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
JavaScript syntax:-Error()
-Error(aNumber, aText)
Argument list:aNumberAn error number
aTextA text describing the error

When the Error() constructor is called as a function, it creates and initializes a new Error object. The function call Error() is equivalent to the expression new Error() with the same arguments.

See also:Error.prototype


ECMA 262 edition 3 - section - 15.11.1