<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
let json = {
name: "aaa",
age: "48",
sex: "male",
};
console.log(json.name);
console.log(json.age);
console.log(json.sex);
let jsonstr = JSON.stringify(json); // 将对象转换为 JSON 字符串
console.log(jsonstr);
let parsedJson = JSON.parse(jsonstr); // 将 JSON 字符串解析为对象
console.log(parsedJson);
</script>
</body>
</html>