title: Uncaught TypeError: Object.keys called on non-object while trying to access object
body: <p>I am trying to access array inside object using <code>Object.keys(obj.arr));</code> method. If I access array directly like below, then it is giving proper output:</p>
  
  <pre><code> alert(Object.keys(obj.arr));
  </code></pre>
  
  <p>but if I pass array name using parameter then it is giving error : </p>
  
  <pre><code>var selected = "arr";
  alert(Object.keys(obj.arr));
  
  error : Uncaught TypeError: Object.keys called on non-object 
  </code></pre>
  
  <p>There is example : <strong><a href="http://jsfiddle.net/Lv6TY/6/" rel="noreferrer">DEMO</a></strong></p>