1. <script>
    2. //声明JSON对象
    3. //{key:value}{键:值}
    4. //在js中key的引号可以省略
    5. var ming={
    6. "name":"ming",
    7. "sex":"女",
    8. "age":18
    9. }
    10. var chen={
    11. name:"chen",
    12. age:18,
    13. sex:"男"
    14. }
    15. //读取Json的值
    16. console.log(ming.name)
    17. console.log(chen)
    18. //给对象添加属性
    19. ming.skill="js"
    20. console.log(ming)
    21. </script>