title: Problem with "document.write()" an Image Array in JavaScript
body: <p>Am trying to write using <code>document.write()</code> an image at the time from my array. However it does not display any...</p>
  
  <pre><code>// *** Temporal variables
      var i = 0;
      var j = 0;
      var x = 0;
  
      // Create basic linear array
      var ImgArray = []
  
      // Do the 2D array for each or the linear array slots
      for (i=0; i &lt; 4 ; i++) {
          ImgArray[i] = []
      }
  
      // Load the images
      x = 0;
      for(i=0; i &lt; 4 ; i++) { 
          for(j=0; j &lt; 4 ; j++) { 
            ImgArray[i][j] = new Image();
            ImgArray[i][j] = "Images/" + x + ".jpg";
            document.write("&lt;img id= " + x + " img src=ImgArray[i][j]  width='120'   height='120'/&gt;");
            x = x + 1;
          }
          document.write("&lt;br&gt;");
      }
  </code></pre>
  
  <p>What am I doing wrong?</p>