title: Javascript for...in statement gives error when looping through array
body: <p>I just tried the <code>for...in</code> statement in Javascript.</p>
  
  <p>This gives no error:</p>
  
  <pre><code>var images = document.getElementsByTagName('img');
  
  for(x in images){
      document.write(images[x]) + " ");
  }
  </code></pre>
  
  <p>However, this does what it should but gives an error in the FF error console.</p>
  
  <pre><code>for(x in images){
      images[x].style.visibility="visible";
  }
  </code></pre>
  
  <p>This made me VERY curious as to what's going on.</p>
  
  <p>Doing this:</p>
  
  <pre><code>for(x in images){
      document.write(x);
  }
  </code></pre>
  
  <p>...gave me this:</p>
  
  <pre><code>01234567891011121314151617lengthitemnamedItem
  </code></pre>
  
  <p>What's there at the end? I assume this makes the <code>document.images</code> / <code>document.getElementsByTagName('img')</code> array not suitable to use with the <code>for...in</code> statement since the values for x at the end won't correspond to an image? Maybe a <code>for</code> loop is better?</p>