toJSON
Jump to navigation
Jump to search
Description
Syntax
- Syntax:
- toJSON data
- Parameters:
- data - Only certain Data Types are supported:
- Boolean - serialized as JSON boolean
- Number - serialized as JSON number (floating-point)
- String - serialized as JSON string
- Array - Serialized as JSON array. Unsupported elements (e.g. Objects) are converted to JSON null.
- HashMap - Serialized as JSON object. Only String keys are supported, other keys are ignored. Unsupported values (e.g. Objects) are converted to JSON null.
- nil - serialized as JSON null
- Return Value:
- String - JSON string
Examples
- Example 1:
-
Result:
["this","is","an","array"]
- Example 2:
Result (formatted for readability):
{ "bKey": true, "sKey": "Hello there", "oKey": null, "nkey": 42, "hKey": { "key1": "General Kenobi", "key2": true, "yolo": "Hello it's me" } }
- Example 4:
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note