title: Looping through javascript object converts keys to string
body: <p>When I loop through an object in Javascript to extract its keys, why do the keys convert to string when they were intended to be integers ? </p>
  
  <pre><code>obj = {1:'a', 2:'b'};
  arr = [];
  for(var key in obj){
    if (obj.hasOwnProperty(key)){
      arr.push(key);
    }
  }
  </code></pre>
  
  <p>Now <code>arr</code> is <code>[ "1", "2" ]</code> instead of <code>[1, 2]</code></p>