title: Here variable "i" in soundsArray[i], not taking any values
body: <p>Here variable &quot;i&quot; in soundsArray[i], not taking any values, line 4</p>
  <pre><code>   var soundsArray = [&quot;crash&quot;, &quot;kick-bass&quot;, &quot;snare&quot;, &quot;tom-1&quot;, &quot;tom-2&quot;, &quot;tom-3&quot;, &quot;tom-4&quot;];
      for(var i = 0; i&lt;document.querySelectorAll(&quot;.drum&quot;).length; i++){
          document.querySelectorAll(&quot;.drum&quot;)[i].addEventListener(&quot;click&quot;, ()=&gt;{
              var audio = new Audio(`./sounds/${soundsArray[i]}.mp3`);
              audio.play();
          });
      }  
  
     //document.querySelectorAll(&quot;.drum&quot;).length = 7
  </code></pre>