If I have an object with an anonymous function inside how do I know what subobject is being requested so that I can return a value?
var obj = function(a) {
switch (a) {
case 'subprop1': return 'subval1';
case 'subprop2': return 'subval2';
case 'subprop3': return 'subval3';
default: return 'defaultval';
}
}
So if I call:
obj.subprop1
I should get:
subval1