0

I have an array of data like:

var messageArr = [
  messageA: [
    weight: 1,
    type: "pop up",
    content: "lorem ipsum",
  ],
  messageB: [
    weight: 3,
    type: "tile",
    content: "Hello world",
  ],
]

I am looping through it like:

    for (var key of Object.keys(messageArr )) {
      console.log(messageArr.content);
    }

But I cannot output the nested array items - nothing appears in console.

Would anyone know how I can get this to work?

MeltingDog
  • 14,310
  • 43
  • 165
  • 295

0 Answers0