Hoisting
Hoisting — Hoisting is JavaScript's behavior of moving variable and function declarations to the top of their containing scope during compilation. In JavaScript, variable and function declarations are processed before any code is executed. This means `var` declarations and function declarations appear to be "hoisted" to the top of their scope. However, `let` and `const` are hoisted differently — they exist in a "temporal dead zone" until their declaration is reached. This term relates to the Function category of the reference. You will meet hoisting in practice when working with APIs such as Function.prototype.call(), Function.prototype.apply(), Function.prototype.bind(), Function.prototype.toString(). Related terms: Closure, Event Loop, Prototype Chain, Temporal Dead Zone (TDZ), IIFE (Immediately Invoked Function Expression), Currying. Understanding hoisting makes the rest of the JavaScript documentation noticeably easier to follow, because the concept recurs across methods, guides, and error messages. Look up more definitions in the JavaScript glossary.