Why does wrapping a callback in an anonymous function change the meaning of 'this'?

后端 未结 0 1593
谎友^
谎友^ 2020-12-15 12:19

If I have a method that uses the keyword \'this\':

let myObject = {
    logThis: function(){
        console.log(this)
    },
}

And I pass it

相关标签:
回答
  • 消灭零回复
提交回复
热议问题