JS Built-ins
ReferenceErrorbeginner

ReferenceError β€” also an Error

πŸ“– Usage Example
new ReferenceError('x is not defined').message  // β†’ 'x is not defined'

You can create a ReferenceError manually to signal missing variable access.

ReferenceError extends Error

ReferenceError extends the built-in Error class.

Challenge: Verify that a ReferenceError is also an instance of Error.

πŸ’‘ Hints (1)
  • β€’ ReferenceError inherits from Error in the prototype chain.