title: Javascript loop - create variable name
body: <p>this javascript code loads a csv file from my server and creates a variable. </p>
  
  <pre><code>var dateObj = new Date();
  var day = dateObj.getUTCDate();
  var month = dateObj.getUTCMonth() + 1;
  var year = dateObj.getUTCFullYear();
  var zpetne = 5;
  
      function load() {
        for (var y = month - zpetne; y &lt; month; y++) {
          $.ajax({
            url: 'LINK_TO_SITE/CSV_FILES'+ y +'-17.csv',
            dataType: 'text',
          }).done(systemCZ);
  
          function systemCZ(data) {
            window.aktivitaData = data;
          }
        }
      }
  </code></pre>
  
  <p>The problem is that each runing of loop overrides previous data in aktivitaData. I tried edit my variable to </p>
  
  <pre><code>window.aktivitaData + y = data;
  </code></pre>
  
  <p>But it not works. I can't find any solution to get aktivitaData1, aktivitaData2 and so on. How can I declare variable like that?</p>