ES6的箭头函数this和普通函数的this区别

普通函数中,内层函数不能从外层函数中继承this的值,在内层函数中,this会是window或者undefined,临时变量self用来将外部的this值导入到内部函数中(另外的方式是在内部函数执行.bind(this))html ES6中的箭头函数会直接调用的this是继承父级的this。app function fun(){ var self = this; setTimeou
相关文章
相关标签/搜索