title: How to make a triangle using for loop javascript
body: <p>I have a simple question although i cannot manage to resolve this problem. Hope you can help. I need to make triangle using for loop and from this 4 exercises I don't know what to do with the third one. I haven't used Javascript before, so any help would be appreciated.</p>
  
  <p><a href="https://i.stack.imgur.com/fdQjg.png" rel="nofollow"><img src="https://i.stack.imgur.com/fdQjg.png" alt="enter image description here"></a></p>
  
  <pre><code> # # # # #
     # # # #
       # # #     &lt;----- here is triangle i need to make. Just in case 
         # #
           #
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var i;
  var j;
  for (i = 0; i &lt;= 5; i++ )
  {
  document.write("&lt;/br&gt;");
  for ( j = 0; j &lt; 6-i; j++ )
  {
  document.write( "&amp;nbsp&amp;nbsp" );
  }
  for ( j = 6-i; j &lt;= 5; j++ )
  {
  
  document.write( "*" );
  }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is code I wrote for D in photo. 
  And I'm sorry i did not add it at first.</p>