ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
#### Json对象 ``` var xubaoshan = { name: "xubaoshan", age: "22", sex: "male" } console.log(xubaoshan.name); console.log(xubaoshan["sex"]); ``` es6中倘若对象的属性名和值相同可以简写 ``` var name = "xu"; var age = "22"; var xubaoshan = { name, age } console.log(xubaoshan.name); //xu ``` #### 转化 1. JSON.parse():将字符串转化为json对象 2. JSON.stringify():将json对象转化为字符串