Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 11: Managing Errors, Debugging, and Handling Events in JavaScript!

Instruction

TypeError: can't assign to property "x" on "y": not an object

The JavaScript strict mode exception "can't assign to property" occurs when attempting to create a property on a primitive value such as a symbol, a string, a number, or a boolean. Primitive values cannot hold any property.

Message:

  • TypeError: Cannot create property 'x' on number '1' (V8-based)
  • TypeError: can't assign to property "x" on 1: not an object (Firefox)
  • TypeError: At...