Variable Declaration Quiz
Question
Which keyword declares a variable that cannot be reassigned in modern JavaScript?
Hint
Think about which keyword stands for 'constant'.
Explanation
const declares a variable that cannot be reassigned. Once you assign a value with const, it stays fixed for the life of that variable. let allows reassignment, and var is the older pre-ES6 keyword that should be avoided in modern code. static is not a variable declaration keyword in JavaScript.
Related Resources
Related Lessons
- Variables
Learn how variables work in programming.
Related Cheatsheets
- JavaScript Cheatsheet
Quick reference for JavaScript variable keywords.
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.