title: document.write and loops
body: <p>Context: I'm learning Javascript and many of the practice codes use document.write(), however I've been reading that it should be <em>avoided</em>, however some things in JS have embedded document.write()</p>
  <p>e.g.</p>
  <pre><code>var i = 1; 
  do {
      document.write (&quot;Cool&quot;); 
      i = i + 500;
  } while (i &lt;= 10);
  </code></pre>
  <p>Question: do you attempt to rewrite the loop with an alternative document.write() method (e.g. <code>createELement</code> or <code>innerHTML</code>), or do you simply do your best to avoid its use?</p>