Hoisting is an action of javascript interpreter which moves all declarations to the top.
Why hoisting matters? Consider the example shown below.
This example generates an exeption due to calling non-function variable. Because the code shown above actually translates to the following code.
How about the following example?
This example will work due to function declaration hoisting.
Quiz
What is the result of executing this code?