JS Built-ins
TypeErrorbeginner

TypeError β€” also an Error

πŸ“– Usage Example
new TypeError('Not a function').message  // β†’ 'Not a function'

Create a TypeError manually to signal that the wrong type of argument was passed.

TypeError extends Error

TypeError extends the built-in Error class.

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

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