var obj = { name : "XiaoQi", sex : 'female', age : 18, stature : 160, weight : 90, apple : function () { console.log('I am eating apple!!!'); this.weight -- ; }, hamburger : function () { console.log('I am eating hamburger!!It is delicious!!!'); this.weight ++ ; } }
increase:
obj.site = "ZheJiang";
delete:
delete this.weight;
change:
obj .name = "QiQi";
check:
1. In the console:
obj.sex;
2. On the javascript tag:
console.log(obj.sex);