DEV Community

Discussion on: JavaScript Basics- Scopes & Hoisting

Collapse
 
jonrandy profile image
Jon Randy 🎖️

The happens as the JavaScript compiler moves all the declarations of variables and functions at the top of the scope

This is actually not true, but is a convenient mental visualisation

Collapse
 
devdebarshi profile image
Debarshi Bhattacharjee

Yup true. Many things go behind this. Added this, for easy understanding.