DEV Community

Discussion on: Hoisting in JavaScript

Collapse
 
bhagatparwinder profile image
Parwinder 👨🏻‍💻

When I say “created”, I’m referring to the end user looking at the source code. For them the creation has happened yet.

Internally the interpreter creates them before executing the function itself. No one is disagreeing with this.

And you are correct, it is a mental model that helps to understand this concept. The idea that the declarations are hoisted/bubbled up to the top of the source code. No one is trying to mislead.

Thanks for the feedback and linking to a more in depth article ♥️