accidental global variable in sloppy mode❗️
assignment to "undeclared identifier" results in "accidental global variable" / "ReferenceError"❗️
Last updated
Was this helpful?
assignment to "undeclared identifier" results in "accidental global variable" / "ReferenceError"❗️
Last updated
Was this helpful?
⟩ ⟩ ⟩ accidental global variable
⟩ ⟩ ⟩ ⟩ accidental global variable
assignment (=) to undeclared identifier in sloppy mode will result in
unlike global var, these accidental global object property can be deleted by delete
assignment (=) to undeclared identifier in strict mode will result in
️ :
always use strict mode to prevent accidental global variable.