ES6箭头函数可解决this作用域问题 #tags: ES6,Javascript
() => { console.log(this.infoHash) // 此处 this 非当前箭头函数 }
对比
function () { console.log(this.infoHash) // 此处 this 为当前匿名函数 }