Is it possible to tell whether an inherited object property was set to be undefined or doesn't exist at all?
I have a formatting string with a property name in it, and an object that's expected to contain the property. I don't care if the property is the object's own or inherited, I need to know if it exists at all so I can use it, even if it was set as undefined, but if it doesn't exist at all, I need to throw an error.
I know just how many times this subject has been danced around, and with so many opinions about using:
if(prop in obj){
}
and this one:
obj.hasOwnProperty(prop)
And while I clearly cannot use the second one, the first method seems unreliable when it comes to all possible property values.
Is there a reliable way to check if a particular property exists either within object or inherited, even if its value was set to 0 or null or undefined?