ReferenceError

  • Tags
  • Files

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.
Properties inherited from Function.prototype

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 Function.prototype

ReferenceError instances

Properties

constructor
Specifies the function that created an instance's prototype.
name
Error name.

Methods

Although the ReferenceError prototype object does not contain any methods of its own, ReferenceError instances do inherit some methods through the prototype chain.

Methods inherited from Error.prototype
toSource, toString

See also

Contributors to this page: ethertank, Potappo, Sevenspade
Last updated by: ethertank,
Last reviewed by: ethertank,