Skip to content

$ps.JSON.stringify

Overview

This function serializes objects that can be used in "Server Script", such as models, or objects returned from the server, into a string.

Syntax

$ps.JSON.stringify(json)

Parameters

Parameters Type Required Description
json object Yes The object to be serialized.

Return Value

Returns the serialized string.

Usage Examples

In the example below, the content of the JSON object is serialized and output to the console.

JavaScript
context.Log($ps.JSON.stringify({ x: 5, y: 6 }));
Example Output
{"x":5,"y":6}

Supported Versions

Supported Versions Body
1.4.12.0 or later Added Function