var obj = { name: 'jeff', getName: function () { return this.name; } }
es6写法(方法定义里,少写了冒号和function):
var obj = { name: 'jeff', getName () { return this.name; } }
posted on 2017-09-18 16:44 cag2050 阅读(165) 评论(0) 编辑 收藏 举报