
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What are Variable Naming Conventions in JavaScript
While naming your variables in JavaScript, keep some rules in mind. The following are the variable naming conventions in JavaScript −
- You should not use any of the JavaScript reserved keywords as a variable name. These keywords are mentioned in the next section. For example, break or boolean variable names are not valid.
- JavaScript variable names should not start with a numeral (0-9). They must begin with a letter or an underscore character. For example, 123test is an invalid variable name but _123test is a valid one.
- JavaScript variable names are case-sensitive. For example, Name and name are two different variables.
Here are the Examples −
var name; // correct var 2name; // incorrect var _2name; // correct
- Related Articles
- variable naming conventions of java
- Naming Conventions in C#
- Java Naming conventions
- CamelCase in Java naming conventions
- Advantages of naming conventions in Java
- Explain naming conventions for packages in java?
- \nWhy we should follow the naming conventions in Java?\n
- Java variable naming rules
- How to define the naming conventions for JSON field names in Java?
- Best practice for variable and method naming in Java
- What are the rules for naming classes in C#?
- What characters are valid for JavaScript variable names?
- What is Variable Shadowing in JavaScript?
- What is a hierarchical naming system?
- What are variable arguments in java?

Advertisements