`"{"success":true,"code":"200","message":"OK","results":[{"sys_guid":629616,"sys_mino":100197487,"sys_mtno":3020}]}"`; js 解析为对象
时间: 2024-04-15 17:23:20 浏览: 81
GUID.zip_guid_guid 生成器
在JavaScript中,可以使用JSON.parse()方法将一个JSON字符串解析为一个JavaScript对象。下面是一个示例代码[^1]:
```javascript
var jsonString = '{"success":true,"code":"200","message":"OK","results":[{"sys_guid":629616,"sys_mino":100197487,"sys_mtno":3020}]}';
var jsonObject = JSON.parse(jsonString);
console.log(jsonObject);
```
输出结果为:
```javascript
{
success: true,
code: "200",
message: "OK",
results: [
{
sys_guid: 629616,
sys_mino: 100197487,
sys_mtno: 3020
}
]
}
```
阅读全文