javascript json语句 与 js语句的互转
1 //var data = "weihexin" 2 //var data = ["weihexin", 1] 3 var data = {name:"weihexin", id:1} 4 5 6 var json = JSON.stringify(data);//返回 json string 7 console.log(json);//{"name":"weihexin","id":1} 8 9 var _data = JSON.parse(json);//返回 js Object 10 console.log(_data);//{name: "weihexin", id: 1}