实际函数都是由对象调用的, 1.普通函数的this指向window:函数() 2.事件中this指向调用者:function P(){console.log(this)}指向p 3.call的this指向是call的第一个参数:方法(打印this).call(a,'b')指向a 4.定时器的this指向window:setTimeout() 5.构造函数和原型对象中的this,指向new出来的实例对象:原型对象中的this::(构造函数)方法名.prototype.方法名=function(){console.log(this)} 6.ES6类 class中constructor中的this 指向是new的实例对象:class 变量名(构造函数){constructor(){ console.log(this)}}指向实例对象