i have the following json structure:
{
"zip":
[
{
"60656": [{
"requestcount": "1",
"mkId": 20005,
"mdId": 22378,
"vehicle_make": "BMW",
"vehicle_model": "X5",
"stkTypId": 28881
},
{
"requestcount": "1",
"mkId": 20005,
"mdId": 22378,
"vehicle_make": "BMW",
"vehicle_model": "X5",
"stkTypId": 28881
},
{
"requestcount": "1",
"mkId": 20005,
"mdId": 22378,
"vehicle_make": "BMW",
"vehicle_model": "X5",
"stkTypId": 28881
}]
},
{
"77054": [{
"requestcount": "1",
"mkId": 20005,
"mdId": 22378,
"vehicle_make": "BMW",
"vehicle_model": "X5",
"stkTypId": 28881
}]
}
]
} _.forEach(json.zip, function(key, value) {
console.log("********************************************************************************************************")
console.log(key);
for (var i in key) {
console.log("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
console.log(i);
console.log("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
}
});
What is the best to loop over this entire structure? I am trying to gain access to the stkTypId
in each of the unique Zipcode
keys.
I have tried this in a few ways so far but unsuccessful. Also i tried formatting this json code, but for some reason stackoverflow would not let me post the question.