re: 🔥🕺🏼 JavaScript Visualized: Hoisting VIEW POST


It's a nice refreshment to see gifs that break up the text to digestible chunks while also helping with the visualization. Keep it up!

Hoisting is often explained as putting variables and functions to the top of the file

I can see why it's described that way to some extent. Parser needs to go over the whole file/script, and it only does something meaningful with functions, and vars at first. So at the top of the file, very first line, you already have the access to those identifiers.


It’s just important to understand that the parser is not actually physically moving them to the top - as some people like to explain it

code of conduct - report abuse