Bac9_AJlkaLLl,
function fillArray() {
for (var i = 1; i <= quantity; i++) {
var Picture = new Image;
images.push(Picture);
Picture.onload = (function (count) {
return function () {
console.log(count);
imageDimensions[count]({
width: this.naturalWidth,
height: this.naturalHeight
});
}
})(i - 1);
Picture.src = "image/prod/" + i + ".jpg";
}
}
fillArray();