title: Uncaught type error while using IIFE function
body: <p>I'm new to Javascript.Trying to assign background images to div tag through this function:</p>
  <pre><code>(function(){
   
      var images=['image01.jpg','image04.jpg','image12.jpg','image22.jpg','image32.jpg','image42.jpg'];
      
      for(var index=0;index&lt;=images.length;index++)
      {
      var images_class=document.querySelectorAll('.Image_c');
      
      let image_show=images[index];
      images_class[index].style.backgroundImage=`url(images/${image_show})`;
     
  }})();
  </code></pre>
  <p>Background image  Style had been correctly mapped to each div of 6 div tags.
  However , there is uncaught error  as below:</p>
  <pre><code>Uncaught TypeError: Cannot read property 'style' of undefined
      at index2.js:10
      at index2.js:12
  (anonymous) @ index2.js:10
  (anonymous) @ index2.js:12
  </code></pre>
  <p>Anyone can help me understand what this error mean and how to resolve it?</p>