黑马程序员技术交流社区

标题: this指向问题 [打印本页]

作者: LeePK    时间: 2020-11-27 11:45
标题: this指向问题
- [ ] this
  - [ ] 事件处理程序里this指向事件源(注册事件的那个dom)
  - [ ] 构造函数(配合new)里的this指向刚刚创建的对象
  - [ ] setTimeout setInterval this指向window
  - [ ] 普通函数fn调用模式  fn() this===>>>window
  - [ ] 对象调用模式 obj.fn()  this===>>>obj(调用者)
  - [ ] call,apply,bind this===>>>第一个参数(没传参就是window)
  - [ ] 箭头函数没有this,所以如果箭头函数有this(this指向包裹它的局部作用域)




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2