javascript allows the use of variables that have not yet been declared and allows variables to be declared after they were first used. For example, the following syntax is legal:
Hoisting is a behaviour where the javascript engine will move declarations to the top of the current scope so the above code would be interpreted as:
Function Hoisting
Function definitions/declarations are also hoisted such that they can be called before they have been defined as in the following example:
However,