var str = '{"name": "tom","age": 12,"sex": "man"}';var obj = eval("("+str+")");console.log(obj); // {name: "tom", age: 12, sex: "man"}console.log(typeof obj); // object
本文共 223 字,大约阅读时间需要 1 分钟。
var str = '{"name": "tom","age": 12,"sex": "man"}';var obj = eval("("+str+")");console.log(obj); // {name: "tom", age: 12, sex: "man"}console.log(typeof obj); // object
转载于:https://www.cnblogs.com/xlj-code/p/9324604.html