var a={
name:"Rhona",
check:(function(){
return this.name;
})();
}
console.log(a.check)// This returns ""
An empty string I expected it to return Rhona,it didn't give undefined or null but an empty string whats going on here?
And i also want to know why when I access an objects property which isn't there it gives undefined instead of giving not defined I recognize undefined is the value given to variables at creation phase,execution phase then initializes the value so if there is no initialization it stays undefined so when i access an object property lets say a.lastname which isn't present shouldn't java script return not defined why is it giving undefined instead?