Under what circumstances would it be possible that an object is empty, but a property of that object is not?
Code:
console.log('type: '+typeof(widget));
console.log('obj: '+JSON.stringify(widget));
console.log('data: '+JSON.stringify(widget.data));
Output:
[INFO] : type: object
[INFO] : obj: {}
[INFO] : data: {"index":2}
Additionally, for (var prop in widget)
does not execute, and trying to call widget.hasOwnProperty('data')
throws an error.
Edited to add: I should have specified that this is in Titanium, not straight JS, hence the console
calls are the Titanium calls and not Firebug etc.