I have the following JSON object (accessed through item
):
I don't know why this is stumping me, but to access the values of divisions
, I would do either item.divisions
or item["divisions"]
, right? I'm getting undefined
when I try both of those options. What's going on? Am I not accessing the data correctly?
Aaand, here it is:
//options has information like hostname, path, etc.
var req = https.request(options, function(res) {
res.setEncoding('utf8');
res.on('data', function (item) {
console.log(item); //this is the JSON that you're seeing
console.log(item.kind); //undefined
});
});