Loading data from JSON without arrays

Hi there, I am working with API which give me JSON in this format:
{“OBJECT NAME”:
{“OBJECT.NAME#VAR112” : {
“data01”: “BJECT.NAME#VAR112”,
“data02”: “T-9F50. Serial Number: PI040298AA3I003620”,
“data03”: “Grow.Thingful”,
“data04”: 3
},
{“OBJECT.NAME#VAR113” : {
“data01”: “OBJECT.NAME#VAR113”,
“data02”: “T-9F50. Serial Number: PI040298AA3I003620”,
“data03”: “Grow.Thingful”,
“data04”: 3
}
}

There is no [], only {} and there is the name of the object which is different every time (but the same as data01 … How can I parse for example all of the data02s from each object and list it? I am super clued up with working with arrays, but struggling here…any ideas?

Maybe you should try out a for..in () {} loop: :thinking:

"use strict";

const jsonObj = {
  "OBJECT NAME": {
    "OBJECT.NAME#VAR112": {
      "data01": "BJECT.NAME#VAR112",
      "data02": "T-9F50. Serial Number: PI040298AA3I003620",
      "data03": "Grow.Thingful",
      "data04": 3
    },
    "OBJECT.NAME#VAR113": {
      "data01": "OBJECT.NAME#VAR113",
      "data02": "T-9F50. Serial Number: PI040298AA3I003620",
      "data03": "Grow.Thingful",
      "data04": 3
    }
  }
};

for (const name in jsonObj) {
  const vars = jsonObj[name];

  for (const entry in vars) {
    const datas = vars[entry];
    console.info(`${entry}:`);

    for (const data in datas) {
      const info = datas[data];
      console.log(`\t${data}: ${info}`);
    }

    console.log('\n');
  }
}