// 对象 (属性和方法)字面量创建 var person= { name:‘店小二‘, age:22, sexual:‘male‘, school:‘奇怪的大学‘, love:function(){ alert("店小二超级喜欢偷懒"); return ‘偷懒‘; } } console.log(person); console.log(person.name); console.log(person.love);
原文:https://www.cnblogs.com/shannen/p/12465108.html