Site icon DataFlair

Rules to Declare Variables in JavaScript

Full Stack Web Development Courses with Real-time projects Start Now!!

Program 1

/*
   Rules of declare variable

1. A variable name must start with a letter or dollar($) or an underscore(_) 
2. A variable name cannot start with a digit or any other special character
3. No Space allowed in between name of variable
4. A variable name can only contain alpha-numeric characters and 
    underscores (a-z, A-Z, 0-9, and _ and $ )
5. The variable name cannot be any reserve word (key word)
6. There is no limit on the length of the variable name   
7. Varible name is case sensetive
*/

 

Exit mobile version