1.(function(){})()立即执行函数中的this指向windows
2.class 里面的 constructor的this指向实例化对象
class Star(){
this.uname = uname;
this.age = age;
constructor(uname,age){
console.log(this)
}
sing(){
console.log(this.name)
}
}
var ldh = new Star(‘ldh’,18);
ldh.sing();
3. 类里面的方法中的this指向调用该方法的对象ldh
4. 构造函数里面的 原型对象prototype 中的方法里面的this也是指向该方法的调用者