🔰function hoisting
identifier hoisted at top of scope, value initialized to a function value (instantly).
JS ⟩ scope ⟩ hoisting ⟩ function hoisting
with a function declaration:
identifier: hoisted to the top of its scope.
referencing a function in block (FiB) outside block
sloppy mode: ✅ hoisted / initialized to undefined (outside block)
strict mode: ⛔ ReferenceError (invisible outside block)❗
related topics
Last updated