title: How to refer to object fields with a variable?
body: <p>Let's asume that I have an object:</p>
  
  <pre><code>var obj = {"A":"a", "B":"b", "x":"y", "a":"b"}
  </code></pre>
  
  <p>When I want to refer to "A" I just write <code>obj.A</code></p>
  
  <p>How to do it when I have key in a variable, i.e.:</p>
  
  <pre><code>var key = "A";
  </code></pre>
  
  <p>Is there any <em>function</em> that returns a value or <code>null</code> (if key isn't in the object)?</p>