<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
//编写一个JavaScript对象
var obj={
name:"蒋铭基",
id:3,
age:19
}
//将对象转化为JSON字符串
let s = JSON.stringify(obj);
console.log(s);
//将JSON字符串转化为JavaScript对象
let parse = JSON.parse(s);
console.log(parse)
console.log(obj);
</script>
</body>
</html>