var, let, const Concept Check
Concept Check Medium
Question
Which statement about var, let, and const is correct?
Hint
Think about where each declaration is visible.
Explanation
var is function-scoped (visible throughout the enclosing function, hoisted to the top). let and const are block-scoped (visible only within the nearest { } block) and are not initialized until their declaration line (temporal dead zone). const additionally prevents reassignment of the binding.
Related Resources
Related Lessons
- JavaScript Variables
Learn about var, let, and const.
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.