Skip to main content

Hoisting For (let, const, var)

let and const are hoisted to the top of the block they
are in but not initialized to the default undefined value so
we can not use them until they are declared.
If we do,RerefenceError is thrown.

Variables declared using var can be accessed before they are declared and are equal to undefined.

Remember hoisting means declarations are moved to the top of their scope not the initialization.