const controller = {
makeRequest: () => {
console.log(this) // this 是 window
},
helper: () => {
console.log(this)
}
};
const controller = {
makeRequest: function(){
console.log(this) // this 是 controller
},
helper: () => {
console.log(this)
}
};
普通函数可见: