Content Menu

Home-What is JavaScript?

JavaScript tutorials

1. JavaScript Basics

2. JS Simple Coding

3. JS InterActive Content

4. Images and JS

5. JS Functions

6. JavaScript Events

7. JS Conditional

8. JS Loops

9. Other

JavaScript Variables naming Conventions

In javascript programming, it is useful to give meaningful variable names that are easier to remember, recall and understand. Instead of calling the variable that holds country names 'x', we called it 'countryname', this helps in better programming as when working with thousand of lines of codes, you will forget what x refered to. but the word countryname will tell you what the variable actually holds.

Basic Rules

What cannot be used as Variable names

Case Sensitivity
In javascript variable names are case sensitive. Variable names 'studentage', 'Studentage' and 'STUDENTAGE' are considered different variables. Although the letters are same but the case is different in all the three names.

Hungarian notation

JavaScript tutorials

Advance user concept- (you can skip this Paragraph if you want to).
Although variable types are not declared in javascript, it is good programming practice to add a prefix to the variable name describing the type of data you wish to assign with the data. For example, variable studentage will be assigned a numeric value. So we might want to name it num_studentage

a Variable student name that will hold string(text) data might be called str_studentname

NEXT- Javascript Variable Types