this._seconds = seconds; } Countdown.prototype._step = function() { console.log(this._seconds); if (this._seconds > 0) { this._seconds -= 1; } else { clearInterval(this._timer); } }; Countdown.prototype.start = function() { this._step(); this._timer = setInterval(function() { this._step(); }, 1000); }; new Countdown(10).start();