this 指向问题
this 指向问题
基本环境
function
function构造函数
箭头函数
call,apply,bind
function
原则:this永远指向运行时调用这个方法的对象
代码块
function fun(){
const text = ‘test’;
console.log(this.text); // undefined
console.log(this); // Window
}...
转载
2019-02-06 21:48:15 ·
226 阅读 ·
1 评论