My json data structure is as follows:
var json = {
"A": {
"A1": {
"A11": "A",
"A12": "B",
"A13": "C"
},
"A2": {
"A21": "A",
"A22": "B",
"A23": "C"
}
},
"B": {
"B1": {
"B11": "A",
"B12": "B",
"B13": "C"
},
"B2": {
"B21": "A",
"B22": "B",
"B23": "C"
}
}
}
To access a specific element in the json, you can use:
json.B.B13
If you are looking to loop through all objects (A, B), you can achieve this by using a for loop. Here's an example of how you can do it:
I initially tried using for(...) and json[0].B13 but that approach did not work. Can anyone provide guidance on how to accomplish this task?