The value of this varies based on the context in which it’s used.
Source Code
function show() {
console.log(this);
}
show(); // logs global object or undefined in strict mode
let obj = {
show: function() {
console.log(this);
}
};
obj.show(); // logs obj