How do I update a variable from javascript setInterval?
<p>Say I have an object:</p>

<pre><code>var myObj = function {
this.count = 0;
}

myObj.prototype {
   setCount : function() {
       var interval = setInterval(function() {
           this.count++;
       }, 500);
   }
}
</code></pre>

<p>The issue is count is always undefined within the setInterval so i can never increment the count variable within myObj to be something other than 0.</p>
