Last Updated on : 2024-06-05 03:14:36download
This topic describes the utility method that is used to parse a JSON string.
parseJSON
Return the result after the JSON string is parsed.
Name | Data type | Description | Required |
---|---|---|---|
str | string | String | Yes |
Name | Data type | Description |
---|---|---|
finalObj | object |
The result after the JSON string is parsed. |
import { Utils } from "tuya-panel-kit";
const { parseJSON } = Utils.JsonUtils;
parseJSON(str);
//Example:
parseJSON("{a:1, b:2}");
{a: 1, b: 2}
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback