DEV Community

Discussion on: Hoisting variables using the "var" keyword

Collapse
 
hdennen profile image
Harry Dennen

Bit of clarification:
"Simply put, hoisting means that our variable that was hoisted is now available inside of whatever function or block it is contained in."

You are referring here to Lexical Environments, not hoisting.

Hoisting refers to the fact that variable declarations occur before execution, meaning that variables can appear to be used before they are declared in code order due to being "hoisted" in the global context. (Note: the word hoisting is never referred to in the spec).

Other than that great article :)