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
caller, constructor, length, name

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.

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

 

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