Reference
JSON
Encode
| Input | A map or a list. Other types will throw an error. |
|---|---|
| Output | A JSON string encoding of the value. |
Signature
json_encode(a: Any): StringExample
json_encode({"name": "Alice", "age": 30}) // returns '{"name":"Alice","age":30}'Decode
| Input | A JSON string. |
|---|---|
| Output | A value parsed from the JSON string (map, list, number, string, or boolean). |
Signature
json_decode(a: String): AnyExample
json_decode('{"name":"Alice","age":30}') // returns {"name": "Alice", "age": 30}