title: Calling concatenated variables in Javascript
body: <p>Is there a way to include variables in each iteration of a javascript loop? For example if I put this code into a loop</p>
  
  <pre><code>if (e1) {item_text += '{id:"' + id[1] + '",lvl:' + e1lvl + '},&lt;wbr&gt;'} 
  if (e2) {item_text += '{id:"' + id[2] + '",lvl:' + e2lvl + '},&lt;wbr&gt;'} // etc
  </code></pre>
  
  <p>and do something like</p>
  
  <pre><code>for (n = 0; n &lt; id.length; n++) { 
    if (e/*concat var e w/var n?*/) { 
      item_text += '{id:"' + id[1] + '",lvl:' + e/*concat var e w/var n?*/lvl + '},&lt;wbr&gt;'
    }
  }
  </code></pre>
  
  <p>Is there a way to change the number in the var names (<code>e1</code> -> <code>e2</code> etc)  each iteration or do i just have to keep it the long way and write everything out on its own line?</p>