Skip to main content
Version: 1.3.4


The ReferenceError object represents an error when a non-existent variable is referenced.


new ReferenceError()
new ReferenceError(message)
new ReferenceError(message, options)
new ReferenceError(message, fileName)
new ReferenceError(message, fileName, lineNumber)

ReferenceError(message, options)
ReferenceError(message, fileName)
ReferenceError(message, fileName, lineNumber)

Note: ReferenceError() can be called with or without new. Both create a new ReferenceError instance.


  • message optional
    • : Human-readable description of the error.
  • options optional
    • : An object that has the following properties:
      • cause optional
        • : A property indicating the specific cause of the error. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error.