event handlers in javascript
<p>I'm looking to build two functions:</p>

<pre><code>var MyObject = new Object();
MyObject.MyProperty = 1;

function ListenToChange() {
  here I want to listen to changes in MyProperty1 and do something when it changes
}

function ThrowEvent () {
  here I change the value of MyProperty every 5 seconds
  setTimeOut('ThrowEvent', 5000);
}
</code></pre>

<p>I looked at the addEventListener property but it looks like it works for DOM objects. I thought of using the ThrowEvent function to change the value of a hidden div and listen for the changes in the value of the hidden with $('#HiddenDiv').change() but I'm wondering if there's a better way to do it with the addEventListener.</p>

<p>Thanks for your help.</p>
