Variable Naming Rules
Multiple Choice Beginner
Question
Which of the following is NOT a valid variable name in JavaScript?
Hint
Variable names cannot start with a digit.
Explanation
Variable names in JavaScript cannot start with a number. 2ndPlace starts with 2, so it is invalid. Names can start with letters, underscores (_), or dollar signs ($). camelCase, _privateValue, and $price are all valid.
Related Resources
Related Lessons
- Variables
Learn how variables work in programming.
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.