let o = {
a: 123,
b: function () {
console.log(this, this.a);
},
};
(o.b)()
Like this code, my understanding is that the code is like this:
const b = o.b
b() // this is pointing to window
But for (o.b)()
, this
keyword is pointing the o object, why is that?