JavaScript Hoisting

Hoisting is default behaviour of moving declarations to the top. A variable can be used before it has been declared.

Code :