参考链接地址:https://www.cnblogs.com/xiaobuxiong/articles/5795481.html
对象转字符串
var Obj = {"name":"张三"}; var str = JSON.stringify(Obj); console.log(str);
字符串转对象
var Obj = '{"name":"张三"}'; var obj1= JSON.parse(Obj); console.log(obj1);
参考链接地址:https://www.cnblogs.com/xiaobuxiong/articles/5795481.html
对象转字符串
var Obj = {"name":"张三"}; var str = JSON.stringify(Obj); console.log(str);
字符串转对象
var Obj = '{"name":"张三"}'; var obj1= JSON.parse(Obj); console.log(obj1);