面向对象深入理解4

//this 的传递

 1        function Arra() {
 2             var _this=this;     //闭包 this
 3              this.a=12;
 4              setInterval(function(){
 5                  _this.show()
 6              },1000)
 7         }
 8         Arra.prototype.show=function(){
 9             alert(this.a)
10         }
11         var obj=new Arra();
原文地址:https://www.cnblogs.com/deveil/p/6273435.html