Instances of Error objects are thrown as exceptions when runtime errors occur.
|To create an object:||new Error(message)|
|You uses the new keyword to create an object.|
|To use as a function:||Error(message)|
|When the Errort object is used as a function the return will be an Error object as well.|
|message:||An optional error message that provides details about the exception.|
Some error types are inherited from the Error object:
|EvalError:||This Error type indicates that the global function eval was used in a way that is incompatible with its definition.|
|RangeError:||This Error type indicates a numeric value has exceeded the allowable range.|
|ReferenceError:||This Error type indicate that an invalid reference value has been detected.|
|SyntaxError:||This Error type indicates that a parsing error has occurred.|
|URIError:||This Error type indicates that one of the global URI handling functions was used in a way that is incompatible with its definition.|
- For alle these above Error types only the 'name' property value differ from the Error object (se reference below). For instance the 'name' property value for a SyntaxError is 'SyntaxError'.
General information about the object member types:
- Prototype created methods, properties or constants can only be used on instances of an object or on a primitive datatype.
- Constructor created methods, properties or constants can NOT be used on instances of an object or on a primitive datatype.
|Returns an implementation defined string.|
|This property of the Error.prototype holds the reference back to the Error object.|
|Important note:||This is the same as the constructor property of an instantiated object|
|The initial value of Error.prototype.message is an implementation-defined string.|
|Important note:||New instantiated objects inherit this property.|
|The initial value of Error.prototype.name is "Error".|
|Important note:||New instantiated objects inherit this property|
Constructor (Error) Properties:
|The constructor property is a reference to the function that will be invoked to create a Error object.|
|The prototype property is a reference to an object that contains all build-in methods and properties that can be used by alle instances of Error-objects.
You can apply your own properties or methods to the Error object through this prototype property.
|Important note:||Is not directly available on an instantiated object.|
© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the
correctness in the pages or source codes.
The risk of using this web-site pages or any program
codes from this website is entirely at the individual user.