Skip to main content

json

Converts the input variable of any type to a JSON formatted string

Syntax

string = json(var)

Example

obj = Object()
obj.name = "John"
obj.age = 43

print json(obj)

Displays

> {
"_id": "obj",
"age": "43",
"name": "John"
}