I have a method in an object which takes a callback:
const obj = {
test(callback) {
callback();
},
};
function getThis() {
console.log(this);
}
obj.test(getThis);
I think “this” will point to “obj” object but it point to Window object. Please help me explain, thank you!