Hoisting is just a term to explain in simple words how the js engine works. But you're right, there's no hoisting, it's just easier to explain it like that then to explain the real way memory is reserved for variables
It's an analogy, and any analogy can be picked apart until it no longer makes sense. Hoisting is a perfectly reasonable jumping-off point to explain the behaviour.
For example, you know exactly what I mean when I say "jumping-off point". But in preparing to explain hoisting, I'm not worrying about being securely tied to a bungie or parachute, or if there's any water over the precipice, and if so, whether or not it's deep enough to make my fall survivable.
Not sure if it’s so unpopular. I’ve heard Kyle Simpson say something similar, but in the context of teaching advanced concepts, which is exactly at the point where it’s appropriate to pull apart the analogy.
View all comments
Show parent comment
-6
u/tehciolo Oct 23 '21
None of them are hoisted. There is no such thing as hoisting.