title: Nested while loops in javascript
body: <p>I'm trying to make a grid of stars with a nested <strong>while</strong> loop.</p>
  
  <p>It does work with a <strong>for</strong> loop:</p>
  
  <pre><code>for(m = 1; m &lt;= 5; m++) {
      for(n = 1;n &lt;= 10; n++) {
          document.write("*" + " ");
      }
      document.write("&lt;br&gt;");
  }
  </code></pre>
  
  <p>but I can't figure out how I can solve it with a while loop:</p>
  
  <pre><code>while(m &lt;= 5) {
      while(n &lt;= 10) {
          document.write("*" + " ");
          n++;
      }
      document.write("&lt;br&gt;");
      m++;
  }
  </code></pre>
  
  <p>Does anyone have any idea?</p>
  
  <p>Thnx</p>