2.6. Literals
A literal is a _data value _ that appears directly in a program. The
following are all literals:
12 // The number twelve
1.2 // The number one point two
“hello world” // A string of text
‘Hi’ // Another string
true // A Boolean value
false // The other Boolean value
/javascript/gi // A “regular expression” literal (for pattern matching)
null // Absence of an object
2.7. Identifiers
An identifier is simply a name . In JavaScript, identifiers are used to
name variables and functions, and to provide labels for certain loops in
JavaScript code. The rules for legal identifier names are the same in
JavaScript as they are in Java and many other languages. The first character
must be a letter, an underscore (_), or a dollar sign ($).[*] Subsequent
characters can be a letter, a digit, an underscore, or a dollar sign. (Digits
are not allowed as the first character so that JavaScript can easily
distinguish identifiers from numbers.) These are all legal identifiers:
i
my_variable_name
v13
_dummy
$str