Detect when a new property is added to a Javascript object?
- by UICodes
A simple example using a built-in javascript object:
navigator.my_new_property = "some value"; //can we detect that this new property was added?
I don't want to constantly poll the object to check for new properties.
Is there some type of higher level setter for objects instead of explicitly stating the property to monitor?
Again, I don't want to detect if the property value changed, but rather when a new property is added.
Ideas?
thanks