title: Iterate over Array of images
body: <p>I've created an array and pushed 30 Images into it, and implemented the keyPressed() function to change the image drawn randomly from the array but when I test it, it just changes the image one time only without looping over the array.</p>
  <p>here is my example code simulates my problem</p>
  <pre><code>function keyPressed() {
      loop();
      //press left arrow to change pic
      if(keyCode === LEFT_ARROW){
          for(var i = 0; i &lt; imgs.length; i++){
              image(imgs[i], 0 ,0);
          }
      }
  }
  </code></pre>