Reputation: 7127
i have a object like the following
{"7036":{"7073":"","7075":"","7077":"","7079":"2","7352":"3"}
How do i read the value of 7352
if that's the only information i have?
For ex: i want to get the value of 3
and in my code i can get the value of 7352
Upvotes: 0
Views: 31
Reputation: 1422
var json = '{"7036":{"7073":"","7075":"","7077":"","7079":"2","7352":"3"}}';
var obj = JSON.parse(json);
for(var k in obj) {
var innerObj = obj[k];
for(var item in innerObj) {
console.log(item);
console.log(innerObj[item])
}
}
Upvotes: 1