Day_13 #15

Open
opened 2026-09-13 08:17:04 +08:00 by pjc · 6 comments
Owner
No description provided.
let person = {
    name:"张三",
    age:18,
    hobbies:["代码","篮球"]
}
let person_json = JSON.stringify(person)
console.log(typeof person_json)
console.log(person)

let resume = JSON.parse(person_json)
console.log(typeof resume)
console.log(resume.age)

image.png

```js let person = { name:"张三", age:18, hobbies:["代码","篮球"] } let person_json = JSON.stringify(person) console.log(typeof person_json) console.log(person) let resume = JSON.parse(person_json) console.log(typeof resume) console.log(resume.age) ``` ![image.png](/attachments/0e51664d-3cf5-4842-9077-314d3dcac3b5)

会用 对象.键 取值
会 JSON 字符串和对象的互相转换
能说出对象和 JSON 字符串的区别
let person = {
name: "张三",
age: 18,
hobbies: ["代码", "篮球"]
};
console.log(person.name);
console.log(person.hobbies[1]);

const ren = JSON.stringify(person);
console.log(ren);

const wu = JSON.parse(ren);
console.log(wu.age);

会用 对象.键 取值 会 JSON 字符串和对象的互相转换 能说出对象和 JSON 字符串的区别 let person = { name: "张三", age: 18, hobbies: ["代码", "篮球"] }; console.log(person.name); console.log(person.hobbies[1]); const ren = JSON.stringify(person); console.log(ren); const wu = JSON.parse(ren); console.log(wu.age);

image.png

![image.png](/attachments/5aae0dec-a30e-4fe2-834f-e03573849791)
276 KiB
  • 会用 对象.键 取值
  • 会 JSON 字符串和对象的互相转换
  • 能说出对象和 JSON 字符串的区别
let person = {
  name: "张三",
  age: 18,
  hobbies: ["代码", "篮球"]
};

console.log(person.name);
console.log(person.hobbies[0]);

let jsonStr = JSON.stringify(person);
console.log(jsonStr);

let parsed = JSON.parse(jsonStr);
console.log(parsed.age);
- [x] 会用 `对象.键` 取值 - [x] 会 JSON 字符串和对象的互相转换 - [x] 能说出对象和 JSON 字符串的区别 ```ts let person = { name: "张三", age: 18, hobbies: ["代码", "篮球"] }; console.log(person.name); console.log(person.hobbies[0]); let jsonStr = JSON.stringify(person); console.log(jsonStr); let parsed = JSON.parse(jsonStr); console.log(parsed.age); ```

会用 对象.键 取值
会 JSON 字符串和对象的互相转换
能说出对象和 JSON 字符串的区别

会用 对象.键 取值 会 JSON 字符串和对象的互相转换 能说出对象和 JSON 字符串的区别

image.png
都会了,在ai的辅助记忆下已会使用JSON.stringify与JSON.parse

![image.png](/attachments/8c719f13-3c4a-419e-b0ba-a07afcb39ef2) 都会了,在ai的辅助记忆下已会使用JSON.stringify与JSON.parse
186 KiB
Sign in to join this conversation.