Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Contrast function hoisting (fully hoisted and callable before declaration), var hoisting (declaration hoisted but value is undefined), and let/const temporal dead zone (not accessible before declaration). Loop scoping highlights var leaking into outer scope versus let being block-scoped.
JavaScript hoists declarations during the compile phase. Function declarations are fully initialized, var is initialized to undefined, and let/const remain uninitialized until execution reaches the declaration.
Updated Feb 2026