public static stringify(value as Object, spaces as Boolean = true, pretty as Boolean = false, indent as Int = 0) as String throws JSONWriteException:
Serializes a value as JSON.
| Parameter | Description |
|---|---|
value | Value to serialize, including null. |
spaces | When pretty is false, controls compact spacing. |
pretty | Enables multi-line formatting. |
indent | Indentation width when pretty is true. A non-positive value falls back to 4 spaces. |
Serialized JSON text.
config = {"fullscreen": true, "theme": "dark"}
print(JSON.stringify(config, pretty=true, indent=2))