Javascript Variable


Javascript Variable

Variable
is an object that contains datas, which may be modified during program execution. In JavaScript we can give the name of the variable along that we like, but must meet the following criteria :


  1. The variable name must begin by a letter (uppercase and lowercase letters) or one ''_'' character.
  2. The variable name can only contain letters, numbers or _ and & characters (blank space is not allowed).
  3. The variable name must not take the name of the following names (reserved by the program) :
  • abstract
  • boolean break byte
  • case catch char class const continue
  • debugger default delete do double
  • else export extends
  • false final finally float for function
  • goto
  • if, implements, import, in, infinity, instanceOf, int, interface
  • label, long
  • native, new, null
  • package, private, protected, public
  • return
  • short, static, super, switch, synchronized
  • this, throw, throws, transient, true, try, typeof
  • var, void, volatile
  • while, with

In JavaScript we use a case sensitive system which means that distinguishes a variable name with uppercase and lowercase letters, and therefore make it a habit to give the name of the variable with the same rules, all capital letters or all small letters (it is recommended to always use lowercase).

0 comments:

Post a Comment