title: Javascript, For loop: returned 'i' value is different from that is stored
body: <p>In this loop the <code>alert(i)</code> alerts 12,and firebug displays <strong>10</strong> as the end result.</p>
  
  <pre><code> for(var i=0;i&lt;=10;i=i+2){
        document.write=i;
      }
  
      alert(i);
  </code></pre>