Comment on page
Hoisting and Scope
What happens if we call a function before it is defined?
Variables and functions are declared within other blocks of code (a loop, for example).
Can I use a variable anywhere I want?
Imagine if we never released the memory used by a variable. When a variable is created, memory is allocated for that data. When the block of code where that variable exists has ended, the memory is released (no longer needed). This helps with the efficiency of the program.
The other thing to note is the use of the term
varand certainly never leave out the declaration.
a = 4and it still works.
<< More to come >>