title: Is there a way to detect when an object's properties have been changed?
body: <p>How can I detect if an object's properties have changed in Javascript? I'm specifically looking to call a function when the amount of properties on an object has changed (whether it has gained or lost properties). I'd like to avoid using methods and to set and change the object's properties as that would get rather clumsy rather quickly, and <code>setInterval</code> is obviously not an option. So, is this possible?</p>
  
  <hr>
  
  <p>Edit: I'm specifically looking for a way to get the length of an object's properties via a <code>length</code> property similar to what's on the Array object. I assumed they changed the length whenever an index was added or removed, but apparently this isn't the case. How did the original designers of Javascript manage this?</p>