JS Built-ins
Errormessagebeginner

Error.message β€” RangeError message

πŸ“– Usage Example
try {
  throw new Error('timeout')
} catch (e) {
  console.log(e.message)  // β†’ 'timeout'
}

Access e.message inside catch blocks to display or log the error description.

RangeError.message

new RangeError('out of range').message returns the message.

Challenge: Verify the message on a RangeError.

πŸ’‘ Hints (1)
  • β€’ RangeError is a subclass of Error.