json
json
Function
Serialize the value to a standard JSON string.
Syntax
json(value)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| value | Any | No | Null | The value to serialize. |
Return value
| Type | Description |
|---|---|
| String | Returns a JSON string. |
Example
result = json({name: 'BT'}) // Output: {"name":"BT"} print result
Notes
- Strings will be wrapped in JSON quotes and escapes.
- Standard JSON does not have a
emptytype,emptywill be serialized into JSONnull.