title: Understanding object initializer notation in JavaScript
body: <p>In the <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.1.5" rel="nofollow"><strong>sec 11.1.5</strong></a> of ECMA-262 we have the object declaration notation:</p>
  
  <pre><code>ObjectLiteral :
      { }
      { PropertyNameAndValueList }
      { PropertyNameAndValueList , }
  PropertyNameAndValueList :
      PropertyAssignment
      PropertyNameAndValueList , PropertyAssignment
  PropertyAssignment :
      PropertyName : AssignmentExpression
      get PropertyName ( ) { FunctionBody }
      set PropertyName ( PropertySetParameterList ) { FunctionBody }
  PropertyName :
      IdentifierName
      StringLiteral
      NumericLiteral
  PropertySetParameterList :
      Identifier
  </code></pre>
  
  <p>Well, consider the following <code>ObjectLiteral</code>: <code>{prop: 'prop'}</code>. Thus we have literal of the form <code>{PropertyName: AssignmentExpression}</code>. Now clearly that <code>'prop'</code> is <code>AssignmentExpression</code>. By defenition from <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.13" rel="nofollow"><strong>sec 11.13</strong></a>, <code>AssignmentExpression</code> is</p>
  
  <pre><code>AssignmentExpression :
      ConditionalExpression 
      LeftHandSideExpression = AssignmentExpression 
      LeftHandSideExpression AssignmentOperator AssignmentExpression
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p>Why <code>'prop'</code> is <code>AssignmentExpression</code>? There is no <code>AssignmentOperator</code> or <code>=</code> and <code>'prop'</code> is no <code>ConditionalExpression</code> certanly.</p>