JavaScript Editor Ajax toolkit     Ajax website 



Main Page

In JScript, identifiers are used to:

Using identifiers

JScript is a case-sensitive language. Consequently, a variable named myCounter is different from a variable named MyCounter. Variable names can be of any length. The rules for creating valid variable names are as follows:

  • The first character must be a Unicode letter (either uppercase or lowercase) or an underscore (_) character. Note that a number cannot be used as the first character.

  • Subsequent characters must be letters, numbers, or underscores.

  • The variable name must not be a reserved word.

Here are some examples of valid identifiers:

В CopyCode imageCopy Code
_pagecount 
Part9 
Number_Items 

Here are some examples of invalid identifiers:

В CopyCode imageCopy Code
99Balloons // Cannot begin with a number. 
Smith&Wesson // The ampersand (&) character is not a valid character for variable names. 

When choosing identifiers, avoid JScript reserved words and words that are already the names of intrinsic JScript objects or functions, such as String or parseInt.

See Also



JavaScript Editor Ajax toolkit     Ajax website


©