JS Built-ins
TypeErrorintermediate

TypeError β€” throwing and catching

πŸ“– Usage Example
undefined()  // throws TypeError: undefined is not a function

Calling something that is not a function throws a TypeError.

Catching TypeError

Accessing a property on null throws a TypeError at runtime.

Challenge: Catch the TypeError and verify it is an instance of TypeError.

πŸ’‘ Hints (1)
  • β€’ Accessing a property on null or undefined throws a TypeError.