Hoisting is one of those fundamental JavaScript concepts that can really throw you for a loop if you don't understand it.
This hopefully clarifies how it works!
Part of the 'What the Fork' series where I illustrate essential dev topics.
#JS #JavaScript #whatthefork
Conversation
that does not look right though. It says "all declarations are hoisted ... we can use .. a variable before we declare it ... as long as we assign it above where we need to use it". It wouldn't work with `let` due to tdz (and makes no sense for `const` at all).
2
1
Youโre definitely right - I didnโt understand all the nuances ES6 let/const/class add to the hoisting equation but can see parts of this need revision. Am going to do more research and fix it this weekend to ammend the mistakes. Thanks for pointing it out! ๐

