Last updated 2 years ago
Was this helpful?
⟩ ⟩ undeclared
assignment (=) to an undeclared identifier in sloppy mode will result in an accidental global variable in sloppy mode❗️
temporal dead zone
👉 related:
typeof undeclared === "undefined" // true
assignment (=) to undeclared identifier will result in
accidental global variable in sloppy mode❗️ (in sloppy mode)
️ : (in strict mode)
there is NO way to write a function to check if an identifer is declared.
// 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()❗
⭐️
⟩