JavaScript Preload Images

var images = [];
var images_to_preload = [
  'path/to/image/one',
  'path/to/image/two'
];

function preload(images_list) {
     for (var i = 0; i < images_list.length; i++) {
         images[i] = new Image();
         images[i].src = images_list[i];
     }
}

preload(images_to_preload);