Learning overview
- Estimated time
- 4 minutes
- Difficulty
- Beginner
- Prerequisites
- No prior experience required
- Learning outcome
- Explain javascript using a clear mental model · Apply javascript in practical JavaScript work
- Last updated
- July 18, 2026
Separate bindings from values
A declaration creates a binding in a scope. The binding can refer to a primitive value or an object. Const prevents that binding from being reassigned, but properties of a referenced object can still change.
const course = { title: "JavaScript" };
course.title = "Modern JavaScript"; // object mutation is allowed
// course = { title: "CSS" }; // TypeError: assignment to const binding
let progress = 0;
progress = 1; // intentional reassignmentUse lexical block scope
Let and const belong to the nearest block. Code can access outer bindings according to where functions and blocks are written, which is lexical scope. Before initialization, a binding exists in the temporal dead zone and cannot be read.
Choose declarations from intent
Use const by default because it communicates that the binding will remain stable. Use let when reassignment is part of the algorithm, such as a counter or accumulated result. Avoid var in new code unless its function-scoped behavior is specifically required.
- Give bindings names that describe domain meaning
- Keep scope as small as practical
- Do not reuse one variable for unrelated meanings
- Trace reassignment separately from nested mutation
Frequently asked questions
Does const make a JavaScript object immutable?
No. It prevents reassignment of the binding. Use disciplined immutable updates, Object.freeze for shallow runtime protection, or other tools when object mutation must be restricted.
What is the temporal dead zone?
It is the interval between entering a scope and initializing a let, const, or class binding, during which accessing that binding throws a ReferenceError.
Topic graph
A taxonomy-generated path through this subject.
Related courses
Related learning
Recommended automatically from shared technologies, topics, intent, and difficulty.
Related Guides
Related Tutorials
Related Glossary
Related Cheatsheets
Related Projects
Related Interview Questions
Related reading
Hand-picked companion pages that deepen this topic.
Your next steps
