JS Built-ins
Errormessagebeginner

Error.message β€” TypeError message

πŸ“– Usage Example
new Error('').message  // β†’ ''

An empty string message is valid; the message property will be an empty string.

TypeError.message

new TypeError('bad type').message returns the message string.

Challenge: Verify the message on a TypeError.

πŸ’‘ Hints (1)
  • β€’ TypeError is a subclass of Error and inherits .message.