title: Call Javascript Object Method with SetInterval()
body: <p>Here is a <strong><a href="http://jsfiddle.net/zCFr5/">fiddle</a></strong>.</p>
  
  <p>I'm trying to create a countdown object that uses <a href="http://momentjs.com/">moment.js</a> (a plugin that I prefer over using Date())</p>
  
  <pre><code>var Countdown = function(endDate) {
      this.endMoment = moment(endDate);
  
      this.updateCountdown = function() {
          var currentMoment, thisDiff;
  
          currentMoment = moment();
          thisDiff = (this.endMoment).diff(currentMoment, "seconds");
  
          if (thisDiff &gt; 0)
              console.log(thisDiff);
          else {
              clearInterval(this.interval);
              console.log("over");
          }
      }
  
      this.interval = setInterval(this.updateCountdown(), 1000);
  }
  </code></pre>
  
  <p>I then create a instance of the countdown like so:</p>
  
  <pre><code>var countdown = new Countdown("January 1, 2014 00:00:00");
  </code></pre>
  
  <p>However the function only seems to run one time. Any ideas? Should I be using setTimeout() instead?</p>