JavaScript
JavaScript assigned to an undeclared variable
JavaScript threw because code assigned to a variable that was never declared in the current scope.
JavaScript
JavaScript threw because code assigned to a variable that was never declared in the current scope.
Observed message
ReferenceError: assignment to undeclared variable "x"
Why it happens
How to fix it
Official reference
MDN: ReferenceError: assignment to undeclared variable xRelated errors
Explore more