I'm looking for a way to catch Exceptions when accessing missing properties in the object itself.
I'm looking for something like:
var objOne =
{
objTwo: {},
objThree: {},
fallback: function(missingProperty)
{
alert('obj did not contain property ' + missingProperty);
}
}
Calls like objOne.objFour
should be linked to objOne.fallback('objFour')
.
Is there a good way to handle this?