title: JavaScript Pattern
body: <p>I really need help with this:</p>
  
  <p>Write a JavaScript program to display the following patterns:</p>
  
  <ol>
  <li><pre><code>*
  **
  ***
  ****
  *****
  </code></pre></li>
  <li><pre><code>1
  22
  333
  4444
  55555
  </code></pre></li>
  </ol>
  
  <p>I am aware that these patterns share the same concept but I just can't write an algorithm for these patterns.</p>
  
  <p>This is what I've tried:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;jdfkdfkldfko&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script&gt;
          for (var i = 0; i &lt; 5; i++) {
              var x = new
              document.write(+"&lt;br/&gt;");
          }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>