JS Built-ins
Errornamebeginner

Error.name β€” TypeError is 'TypeError'

πŸ“– Usage Example
new TypeError('x').name   // β†’ 'TypeError'
new RangeError('x').name  // β†’ 'RangeError'

Subclasses of Error set their own name to identify the error type.

TypeError.name

new TypeError().name returns 'TypeError'.

Challenge: Verify the name.

πŸ’‘ Hints (1)
  • β€’ TypeError is a subclass of Error with name "TypeError".