title: Why is the Object treated as an Array?
body: <p>In the below code, <strong>obj</strong> is an <strong>object</strong>, but why is its values are accessed using <strong>[key ] like array</strong> instead of a <strong>dot followed by its key</strong>?</p>
  <pre><code>var keys = Object.keys(obj);
  
  for (var i = 0; i &lt; keys.length; i++) {
      var val = obj[keys[i]];
      // use val
  }
  </code></pre>