4.1 Primary Expressions
Literals are constant values that are embedded directly in your program. They look like these:
// A number literal
// A string literal
// A regular expression literal
// Evalutes to the boolean true value
// Evaluates to the boolean false value
// Evaluates to the null value
// Evaluates to the "current" object
We learned about
null in §3.4 and
§3.5. Unlike the other keywords,
this is not a
constant—it evaluates to different values in different places in the
this keyword is used in object-oriented programming.
Within the body of a method,
this evaluates to the object on which
the method was invoked. See §4.5, Chapter 8
(especially §8.2.2), and Chapter 9 for more on
Finally, the third type of primary expression is a reference to a variable, constant, or property of the global object:
// Evaluates to the value of the variable i.
// Evaluates to the value of the variable sum.
// The value of the "undefined" property of the global object