this 的指向
const A = {
name: '张三',
describe: function () {
return '姓名:'+ this.name;
}
};
const name = '李四';
const f = A.describe;
f() // "姓名:李四" - 相当于 window 调用了
1. 方法调用
2. new 实例调用
3. call/bind/apply 绑定
3.1 call()
3.2 apply()
3.3 bind()
3.4 总结
类型
调用方式
第一个参数
其余参数
4. 箭头函数中的 this
5. 总结
最后更新于