JS Built-ins
Errornamebeginner

Error.name β€” ReferenceError is 'ReferenceError'

πŸ“– Usage Example
const err = new Error('x')
typeof err.name  // β†’ 'string'

The name property is always a string that identifies the error type.

ReferenceError.name

new ReferenceError().name returns 'ReferenceError'.

Challenge: Verify the name.

πŸ’‘ Hints (1)
  • β€’ ReferenceError is thrown when accessing undeclared variables.