Undefined when displaying Img's

I have been playing with this code for a while and I was wondering why when I try to add img’s to the array on the js code makes the images appear on DOM but also makes a bunch of Undefined elements appear, How can I just make the 15 images appear without the undefined?

Using this method works fine, I wonder if this is an efficient way to do it. Thaks

var arrayOfImages = [

const images = []

for (var i = 0; i < 36; i++) {
    title: "Image " + (i + 1),
    source: arrayOfImages[i]

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.