function Rectangle(w) { this.width = w; var that = this; this.downShow = function() { that.width = that.width - 1; console.log(that.width, rect1.width); } } var rect1 = new Rectangle(100); setInterval(rect1.downShow, 200);