//this keyword always refers to the calling site it means how a function is called //Except arrow function & arrow function refer to lexical scope; global.zahid="Mollik"; const ob={ name:"Mollik", show:function(){ console.log(this);//when show method call with ob then this keyword refer to that ob object function x(){ console.log(this);//here this function call like a normal function & we know in regular function this keyword refer to global object console.log(this.zahid)//that's why we access zahid here }; x(); (()=>{ console.log(this);// refer to lexical scope & it lexical scope is show method console.log(this.name)//In show method this keyword refer to ob object })(); } } console.log(ob.show());