What is Hoisting in JavaScript?

Hoisting is the default behavior of JavaScript that moves all variable declarations to the top of the current scope. The scope may be the current script of the current function.

JavaScript Declarations are Hoisted. It means a variable can be used before it has been declared.