title: How to join 2 variables in a for loop(javascript)
body: <p>I am trying to combine 2 variables in a loop, as the code below show i need to add a number to every <code>var</code>, but i cant get it to work. This is just a part of a script. As you can see the <code>var item</code> should become <code>item1</code>, <code>item2</code>, <code>item3</code> and so on.</p>
  
  <p>// the code</p>
  
  <pre><code>for (i=0; i&lt;10; i++){
      var item+' '+i = $('ul').find('.list-item-'+i).text();
  }       
  </code></pre>