I result I expected was Adithye. I knew other methods, but i would like to know why this method wont work.
var Person = {
name:'Adithye',
getName:function(){
function xyz(){
console.log(this.name);
}
xyz();
}
}
Person.getName();
In the inner function, though, this no longer refers to Person. Hence, this.name is undefined in the inner function