function test(){ var obj=this; this.message="hello"; this.run=function(){ alert(obj.message); setTimeout(obj.run,1000); } } new test().run();