title: Access local object properties from internal function (Javascript)
body: <p>I've got a Javascript object that is trying to access a local property from inside a setInterval() in a method, but apparently because it is trying to call the local scope of the function in the setInterval, the local property is returning undefined.  Here's the code:</p>
  
  <pre><code>function Timer() {
      this.remaining = 15000;
  }
  
  Timer.prototype.start = function() {
  this.refreshId = setInterval(function() {
      console.log(this.remaining);
  },1000);
  }
  </code></pre>
  
  <p>How can I access that local 'remaining' variable?  Thanks!</p>