I need to iterate through a JSON array object with the following structure:
var myJSONObject = {
"abc": {
"prod_1": [
{"prod_ver" : "prod 1 ver 1"},
{"prod_ver" : "prod 1 ver 2"},
],
"prod_2": [
{"prod_ver" : "prod 2 ver 1"},
{"prod_ver" : "prod 2 ver 2"},
],
"prod_3": [
{"prod_ver" : "prod 3 ver 1"},
{"prod_ver" : "prod 3 ver 2"},
]
}
};
The task involves looping through the product names and their respective versions. Each product name contains a list of its versions.
I am looking for a JavaScript solution that can handle multiple products and versions dynamically, providing the product name and version separately in variables for further processing.
If there is a better JSON structure or any suggestions for improvement, please advise on the appropriate format.
Your assistance is much appreciated.