title: JavaScript and square bracket notation
body: <p>I am new in Java Script. In both of my books: <a href="http://www.larryullman.com/books/modern-javascript-develop-and-design" rel="nofollow">http://www.larryullman.com/books/modern-javascript-develop-and-design</a> and <a href="http://www.packtpub.com/object-oriented-javascript/book" rel="nofollow">http://www.packtpub.com/object-oriented-javascript/book</a>
  both authors are saying that this notation: <code>object[unknownYetProperty]</code> should work when we have object and variable which is objects future property. The problem is two others notation works <code>object['unknownYetProperty']</code> and <code>object.unknownYetProperty</code> but not first one. </p>
  
  <pre><code>var a1 = 'spring';
  var a2 = 'autumn';
  var a3 = 'summer';
  
  var object = {
      propertyA1 : a1, // according to books this only this should work :-/
      propertyA2 : a2,
      propertyA3 : a3
  }
  
  console.log(object[propertyA1] + ' ' + object['propertyA2'] + ' ' + object.propertyA3);
  </code></pre>
  
  <p>The working example:
  <a href="http://jsfiddle.net/cachaito/p78Le" rel="nofollow">http://jsfiddle.net/cachaito/p78Le</a></p>
  
  <p>Could anyone explain it to me?</p>