title: Create multiple variables inside for loop
body: <p>I am trying to create multiple new variables inside a loop.
  The number of new variables depends on the lenght of another variable (variable "list" used below).</p>
  
  <pre><code>for(var i = 0; i &lt; list.lenght; i++) 
  { 
  var counter + i;   // create new variable (i.e. counter1, counter2,...)
  }
  </code></pre>
  
  <p>I found a lot of very simmilar questions on StackOverflow, and the answer is mostly using an array (i.e. <a href="https://stackoverflow.com/questions/8260156/how-do-i-create-dynamic-variable-names-inside-a-loop">How do I create dynamic variable names inside a loop?</a>). </p>
  
  <p>If I use the suggested solution, do I create an array of variables? So in my case I will create multiple counters and I can then add values to that variables, i.e.:</p>
  
  <pre><code>counter6++;
  </code></pre>
  
  <p>If that is not the case how could I tackle the problem?</p>
  
  <p>I apologize for asking you to explain an old answer, but I cannot comment in the old one because of low reputation.</p>