Summary
Represents an error when a non-existent variable is referenced.
Description
A ReferenceError is thrown when trying to dereference a variable that has not been declared.
Syntax
new ReferenceError([message[, fileName[, linenumber]]])
Parameters
- message
- Human-readable description of the error
- fileName
- Non-standard
- The name of the file containing the code that caused the exception
- lineNumber
- Non-standard
- The line number of the code that caused the exception
Properties
For properties available on ReferenceError instances, see Properties of ReferenceError instances.
prototype- Allows the addition of properties to an ReferenceError object.
Methods
For methods available on ReferenceError instances, see Methods of ReferenceError instances.
The global ReferenceError contains no methods of its own, however, it does inherit some methods through the prototype chain.
Methods inherited from Object.prototype
__defineGetter__, __defineSetter__, hasOwnProperty, isPrototypeOf, __lookupGetter__, __lookupSetter__, __noSuchMethod__, propertyIsEnumerable, unwatch, watch
__defineGetter__, __defineSetter__, hasOwnProperty, isPrototypeOf, __lookupGetter__, __lookupSetter__, __noSuchMethod__, propertyIsEnumerable, unwatch, watch
ReferenceError instances
Properties
- constructor
- Specifies the function that created an instance's prototype.
name- Error name.
Methods
- constructor
- Specifies the function that created an instance's prototype.
name- Error name.
See also
Mozilla Developer Network