• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

6.5. Expressions

6.5.1. Primary Expressions

Primary expressions are constructed using the this keyword, identifiers, and literals. The this keyword evaluates to the this value of the execution context. An Identifier is evaluated using the scoping rules stated previously. The result of evaluating an Identifier is always a value of type Reference. A literal is evaluated using the literal grammer. An array initializer is an expression describing the initialization of an Array object, written in form of a literal. It is a list of zero or more expressions, each of which represents an array element, enclosed in square brackets. The elements need not be literals; they are evaluated each time the array initializer is evaluated. Array elements may be at the beginning, middle, or end of the element list. Whenever a comma in the element list is not preceded by an AssignmentExpression (i.e., a comma at the beginning or after another comma), the missing array element contributes to the length of the Array and increases the index of subsequent elements. Elided array elements are not defined.

6.5.2. Object Initializer

An object initializer is an expression describing the initialization of an Object, written in a form resembling a literal. It is a list of zero or more pairs of property names and associated values, enclosed in curly braces. The values need not be literals; they are evaluated each time the object initializer is evaluated. The two key object initializers are left-hand-side expressions and post-fix expressions. For additional details, you are encouraged to review the detailed list of native objects provided by the ECMA Script 3.0 specification.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint