(function(){
var a = 11111;
console.log(this.a);
var Test = function(a){
this.a = a;
}
Test.prototype.geta=function(){
console.log(this.a)
console.log(this);
}
var test = new Test('a');
test.geta();
var getaaa = test.geta;
getaaa();
})()

getaaa()中 this 指向的是 window 但是为什么 this.a 为什么是 undefined
函数式编程
喵喵时光机
随时随地看视频慕课网APP
相关分类