title: Why gives me undefined?
body: <p>This is i am currently working on:</p>
  <pre><code>images = doc.data().imgs;
  linkZips = doc.data().zips;
  
  for (i = 0, len = images.length; i &lt; len; i++) {
  
      for (x = 0, lens = linkZips.length; x &lt; lens; x++){
          $(&quot;.downloadZip&quot;+x).click(function(){
              console.log(linkZips[x]);
          });
        };
  
      $(&quot;#allgames&quot;).append(`
          &lt;div class=&quot;col&quot;&gt;
              &lt;a class=&quot;downloadZip`+i+`&quot;&gt;
                  &lt;div class=&quot;card mb-4 text-center&quot;&gt;
                      &lt;img src=&quot;`+ images[i] +`&quot;&gt;
                  &lt;/div&gt;
              &lt;/a&gt;
          &lt;/div&gt;
  
      `);
  
  }
  </code></pre>
  <p>I am a bit of a noob when it comes to javascript, but I cannot seem to find the reason why this is returning &quot;undefined&quot;</p>
  <pre><code>for (x = 0, lens = linkZips.length; x &lt; lens; x++){
      $(&quot;.downloadZip&quot;+x).click(function(){
          console.log(linkZips[x]);
      });
  };
  </code></pre>