//字面量语法 var obj = { name:‘zhangsan‘, age:30, say:function(){ console.log(‘hello‘); } }; console.log(obj.name);//取name值 console.log(obj[‘age‘]);//[]方式取age值 //删除对象成员 delete obj.age;//删除age obj.say();//调用函数方法
原文:https://www.cnblogs.com/dazahui/p/14417758.html