$ps.JSON.parse
Overview¶
Deserializes a json string serialized in the "Server Script" into an object that can be used in the server script.
Syntax¶
Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | json string |
Return Value¶
Returns the deserialized object.
Usage Examples¶
In the following example, a json string is deserialized into a json object and output to the console.
JavaScript¶
const json = $ps.JSON.parse('{ "x": 5, "y": 6 }');
context.Log(`json.x=${json.x}`);
context.Log(`json.y=${json.y}`);
Example output¶
Supported Versions¶
| Supported versions | Body |
|---|---|
| 1.4.12.0 and later | Added function |