title: Javascript not completing a loop
body: <p>My program should take the text from the first paragraph, duplicate it 100 times and put that into paragraph two. But when I do this function:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;p id="first"&gt;First&lt;/p&gt;
  &lt;p id="second"&gt;Second&lt;/p&gt;
  
  &lt;script&gt;
  var i;
  var word = document.getElementsByTagName('p')[0].innerHTML;
  document.writeln(word); //Did this to check if it copied "first" correctly.
  for (i=0; i&lt;100; i++){
      word+=word;
      document.write(i) //Did this to see how man time it loops
  }
  document.getElementById("second").innerHTML = word;
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It returns this in Safari (Loops only 27 times):</p>
  
  <pre><code>First
  Second
  First 0123456789101112131415161718192021222324252627
  </code></pre>
  
  <p>And Returns this in Chrome (Loops only 24 times):</p>
  
  <pre><code>First
  Second
  First 0123456789101112131415161718192021222324
  </code></pre>
  
  <p>Thanks!</p>