title: Should Javascript's "for in" construct iterate the length property?
body: <p>I'm making a bookmarklet, but I've encountered some wierd behaviour in IE8. The code causing the problem is this:</p>
  <pre><code>var els = document.getElementById(&quot;my_id&quot;).getElementsByTagName(&quot;*&quot;);
  for(var i in els)
  {
      alert(i+&quot;,&quot;+els[i])
  }
  </code></pre>
  <p>The first thing that is alerted is &quot;length, n&quot;. This isn't the case in chrome: just in IE8.</p>
  <p>Interestingly, it seems to behave differently depending on whether the code goes in the console/address bar or the page itself.</p>
  <p>Is this standard behaviour?</p>
  <h3>EDIT:</h3>
  <p>Not down to the website that I run it on either. Is it possible that <code>getElementsByTagName</code> returns an array with a <code>&quot;length&quot;</code> key set in IE? It certainly doesn't return a pure array.</p>