var jhon = {
name : 'Jhon' ,
lastName : 'Smith' ,
calculateAge : function (){
this.age = 2016 - this.yearOfBirth ;
}
};
console.log(jhon)
=> "age" propery not in the o/pjhon.calculateAge(); console.log(jhon);
==> "age" property present in the o/p
(This is what confuse me)
console.log(jhon); jhon.calculateAge(); console.log(jhon);
===> "age" property present in both the o/p
Can anyone please explain the reason ?