We learnt that a variable and a function declaration is stored in Variable object even before the execution of JavaScript code starts. During creation phase, the code is scanned for function declaration and for each function a property is created in variable object pointing to that function.
Similarly, code is scanned for variable declaration and for each variable, a property is created in variable object and set to undefined.
Because of this, the variables and functions are available to use in JavaScript program before it is declared. This is called as hoisting. Let’s understand hoisting in detail in this lecture.
Ещё видео!