js 对象

var obj = {
_uid: 1,
text: '小王',
change_text: function () {
this.text = '老王'
},
show_text: function () {
alert(this.text)
}
}
var o1 = obj;
console.log(o1.text);
o1.change_text()
o1.show_text();

posted @ 2018-12-01 14:57  Super-Yan  阅读(90)  评论(0编辑  收藏  举报