1. //单条
    2. var cheng = {
    3. "name":"zhangsan",
    4. "age":18,
    5. "sex":"男",
    6. "like":true
    7. }
    8. //键的双引号可以省略
    1. //多个 “ [] ”
    2. var myfamily = [
    3. {
    4. relation:"dady",
    5. like:"唱歌",
    6. location:"广东"
    7. },{
    8. relation:"mom",
    9. like:"看剧",
    10. location:"江西"
    11. },{
    12. relation:"my",
    13. like:"timi",
    14. location:"湖北"
    15. }
    16. ]
    1. /* 1.读取对象的属性 */
    2. /* .表示的意思 */
    3. console.log(li.name)
    4. console.log(li.age)
    5. /* 2.给对象添加属性 */
    6. li.sex = "女";
    7. console.log(li)