Explain what is Hoisting in Javascript

Technology CommunityCategory: JavaScriptExplain what is Hoisting in Javascript
VietMX Staff asked 3 years ago

Hoisting is the concept in which Javascript, by default, moves all declarations to the top of the current scope. As such, a variable can be used before it has been declared.

Note that Javascript only hoists declarations and not initializations.