How do I Access an Objects properties inside an Array

I have these assets:

const ITEMS = [
  {
    title: 'Walnut Speakers & Amp',
    price: 599,
    image:
      'https://imagepath,
  },
  {
    title: 'Maple Lamp',
    price: 109,
    image:
      'https://imgpath,
  },

I want to access each individual object properties like title, price, and image so I can use it to inject it into my website as HTML in a loop.

@TroydonAnabolic If you only had one object (not in an array), how would you access title, price and image? If you know how to do that and you know how to iterate through an array, then you can do what you are asking. Give it a try and if you get stuck, post what code you have tried and we will try to guide you to a solution.

1 Like

@RandellDawson Thanks for the input and motivation, I was able to find out how easy it was to access it using ITEMS[i].title for e.g.
I was able to loop through it and inject it into my DOM as a standard list… now just gotta find out how to put each of them into a container and objects inside of each other… sounds like it is going to be tough, here I go…

1 Like