javascript class - this.method called with setInterval
<p>I have a javascript class</p>

<pre><code>funtion MyClass() {

  MyClass.prototype.fooMethod = function () {
    // some logic goes here...
  }

  MyClass.prototype.fooMethod2 = function () {
    this.fooMethod();
  }
}
</code></pre>

<p>Everything works as expected when I call like this:</p>

<pre><code>var m = MyClass();
m.fooMethod2();
</code></pre>

<p>However when I have this code called by setInterval I get an error: "Uncaught TypeError: Object [object DOMWindow] has no method 'fooMethod'"</p>

<pre><code>var m = MyClass();
var intervalId = setInterval(m.fooMethod2, 100);
</code></pre>

<p>Is there any way I can use setInverval to call my method?</p>
