📜  javascript代码示例中的序列化和反序列化

📅  最后修改于: 2022-03-11 15:03:46.985000             🧑  作者: Mango

代码示例1
let simpleJSON ={ "name":"John", "age":30, "car":null };
//serialization is converting an object to a string
//...its useful when data is to be transmitted across a network
let simpleString = JSON.stringify(simpleJSON);
console.log(simpleString);

//deserialization is converting a string to an object
console.log(JSON.parse(simpleString));