title: Dispose an image object
body: <p>When creating a new Image element in javascript, Google Chrome's memory tool (Developer tools > Timeline > Memory) considers it as a new DOM element, naturally.</p>
  
  <p>In my case, I'm ending up with 1500+ DOM elements, and I wish to get rid of them. I have tried to save all objects in an array and delete all of them in a loop when I'm ready creating all objects, resulting in the following error:</p>
  
  <p><code>Uncaught TypeError: Cannot call method 'removeChild' of null</code></p>
  
  <p>That indicates the Image objects doesn't appear in the actual DOM.</p>
  
  <pre><code>var images = [];
  var i, image;
  
  for( i = 0; i &lt; urls.length; i++ ) {
      image = new Image();
      image.src = urls[i];
  }
  
  // other stuff happens
  
  for( i = 0; i &lt; images.length; i++ ) {
      // apparently this doesn't work because I'm not adding the image to my DOM
      // images[i].parentNode.removeChild( images[i] );
  
      // delete images
  }
  </code></pre>
  
  <p><strong>Is there a way to remove/delete/unset/dispose the Image objects?</strong></p>