From ed8bfbdd253d4c05920326a948848f394bb4f210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BA=86=E6=B3=89?= Date: Mon, 4 Mar 2024 15:59:26 +0800 Subject: [PATCH] Update json.md --- docs/uts/buildin-object-api/json.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/uts/buildin-object-api/json.md b/docs/uts/buildin-object-api/json.md index de668209..5d6f4379 100644 --- a/docs/uts/buildin-object-api/json.md +++ b/docs/uts/buildin-object-api/json.md @@ -13,7 +13,7 @@ JSON.parse() 方法用来解析 JSON 字符串,构造由字符串描述的对 ```ts const json = `{"result":true, "count":42}`; -const obj = JSON.parse(json); +const obj = JSON.parse(json) as UTSJSONObject; console.log(obj["count"]); // expected output: 42 -- GitLab