Error type

What went wrong?

A value has been assigned to an undeclared variable. In other words, there was an assignment without the var keyword. There are some differences between declared and undeclared variables, which might lead to unexpected results and that's why JavaScript presents an error in strict mode.

Three things to note about declared and undeclared variables:

Declared variables are constrained in the execution context in which they are declared. Undeclared variables are always global.

Declared variables are created before any code is executed. Undeclared variables do not exist until the code assigning to them is executed.

Declared variables are a non-configurable property of their execution context (function or global). Undeclared variables are configurable (e.g. can be deleted).