title: Generating new variables to save loop results
body: <p>I´ll try to be very specific about this topic.</p>
  <p>So I have a &quot;for&quot; loop in javascript working just fine. The loop aims to retrieve the URLs of all the files existing in a target folder. The question is, how can I save the retrieved URLs into individual variables?</p>
  <p>So, in order to make things easy, I won´t paste the code I´m using, I´ll just create a simple array and run a &quot;for&quot; loop as an example, so you guys can tell me how you would try to save the results into new variables.</p>
  <p>So here's the example:</p>
  <pre><code>    var index;
      var arrayElements = [&quot;FirstURL&quot;, &quot;SecondURL&quot;, &quot;ThirdURL&quot;]
  
      for (index = 0; index &lt; arrayElements.length; index++) {
          document.write (arrayElements[index]+&quot;&lt;br/&gt;&quot;);
      }       
      
  </code></pre>
  <p>So, with that code, I can &quot;print&quot; the different URLs included in the array (I could use console.log of course, but I´m writing in notepad++, so I have to test the code with document.write)</p>
  <p>So the question, how can I save each URL into an individual variable?</p>
  <p>EDIT:</p>
  <p>Ok, so reading the first answers, I think I must clarify some things.</p>
  <p>The question is that I need to store the URLs in variables so I can call them later. So it´s not a question about &quot;printing&quot; the URLs.</p>