Hoisting Concept Check
Question
What is hoisting in JavaScript?
Hint
Hoisting moves declarations, not assignments.
Explanation
Hoisting is JavaScript's behavior of moving variable and function declarations to the top of their enclosing scope before code execution. var declarations are hoisted and initialized to undefined. Function declarations are fully hoisted (both name and body). let and const are hoisted but remain in the temporal dead zone until their line. Only declarations are hoisted — assignments stay in place.
Related Resources
Related Lessons
- JavaScript Variables
Learn about hoisting.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.