title: Nested for loops in javascript
body: <p>I was just wondering if I could get some guidance on an issue I am having with nested for loops in javascript.</p>
  
  <p>I currently have the following nested for loop in place</p>
  
  <pre><code>for (var i = 0; i &lt;= score; i++)
  {
      for (var j = 0; j &lt;= i; j++)
      {
          var stsc = '&lt;img src="./images/star.png"/&gt;';
      }
  }
  </code></pre>
  
  <p>The aim is to get the variable stsc to show the number of stars depending on the count of the score variable.</p>
  
  <p>Currently, it will only show 1 star no matter what the value of score is. I have tried adding stsc outside of the nested loop to no avail. No matter what I do it will show nothing other than 1 star.</p>
  
  <p>Could you point me in the right direction as to how to get it to show the correct number of stars (3 stars if score is 3, 0 stars if score is 0 etc...)</p>
  
  <p>Thanks everyone</p>