Here is a good article filled with awesome Hoisting and variable declaration goodness. Below is an overview.
Variables and functions are declared within other blocks of code (a loop, for example).
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
let instead of
var and certainly never leave out the declaration.
<< More to come >>