❗undeclared identifier
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
JS ⟩ identifier ⟩ undeclared
assignment (=) to an undeclared identifier in sloppy mode will result in an accidental global variable in sloppy mode❗️
// assume f is such a function
f(undeclared) // ⛔ ReferenceError
// JS will throw a ReferenceError on accessing `undeclared`
// BEFORE you even have a chance to call f()❗