A primary expression is one that needs no further evaluation to resolve its value.
A primary expression is a specific object, identifier, or literal and may also be the result of evaluating another nested expression that is surrounded by the grouping operators (parentheses).
The this keyword is classed as a primary expression. The value returned by the this keyword depends on the execution context currently being processed.
An identifier is a primary expression if it refers to an object or function.
Constants and string literals are by definition primary expressions.
Any expression within the grouping operators (parentheses) becomes a primary expressions since the rules of precedence dictate that it must be resolved completely before being replaced into the expression to which it is an operand.
An identifier is evaluated according to the current scoping rules presently in force. This would return an internal reference value inside the interpreter but this would be transparent to the user.
Literal values of the following types are considered to be primary expressions:
Null literal
Boolean literals
Numeric literals
String literals
Expressions can be evaluated in the desired order by using the grouping operator or parentheses to nest the expressions. This allows the delete and typeof operations to be applied to expressions.
ECMA 262 edition 2 - section - 7.7
ECMA 262 edition 2 - section - 10.1.4
ECMA 262 edition 2 - section - 11.1
ECMA 262 edition 3 - section - 10.1.4
ECMA 262 edition 3 - section - 11.1
Prev | Home | Next |
prefs.js | Up | Primitive value |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |