标签:
var str1 = ‘{"name": "Lucy", "age": 23}‘; var str2 = {a:1, b: "Jack"}; var a = JSON.parse(str1) //将字符串转换为json对象 var b = JSON.stringify(str2) //将对象解析为字符串 console.log(a, typeof(str1), typeof(a)); console.log(b, typeof(str2), typeof(b));
标签:
原文地址:http://www.cnblogs.com/leijiuling/p/5630956.html