var str = '{"a":"a","b":"b"}';
var jsonstr;
~(function strToJson(str){
jsonstr = (new Function("return " + str))();
// return jsonstr;
})(str);
console.log(typeof jsonstr); //object
console.log(jsonstr); //Object {a: "a", b: "b"}
米琪卡哇伊
缥缈止盈
随时随地看视频慕课网APP
相关分类