I am trying to get a list of tags from an object
Here is the full code and data:
$(document).ready(function() {
obj =
{
"category":[
{
"id":"8098",
"tags":{
"411":"something",
"414":"something else"
}
}
]
};
var tagList = [];
for (var index in obj) {
for (var indexSub in obj[index].tags) {
blah = (obj[index].tags[indexSub]);
tagList.push(blah);
}
}
console.log(tagList);
});
Here's a link to jsFiddle
The problem is that taglist is returning an empty array.
How can I fix this?