SYNTAX
ECMAScript's syntax borrows heavily from C and other C-like languages such as Java and Perl. Developers familiar with such languages should have an easy time picking up the somewhat looser syntax of ECMAScript.
Case-Sensitivity
The first concept to understand is that everything is case-sensitive; variables, function names, and operators are all case-sensitive, meaning that a variable named test
is different from a variable named Test
. Similarly, typeof
can't be the name of a function because it's a keyword (described in the next section); however, typeof
is a perfectly valid function name.
Identifiers
An identifier is the name of a variable, function, property, or function argument. Identifiers may be one or more characters in the following format:
- The first character must be a letter, an underscore (
_
), or a dollar sign ($
). - All other characters may be letters, underscores, dollar signs, or numbers.
Letters in an identifier may include extended ASCII or Unicode...