Most modern languages include a library for dealing with json, including converting a native object to a json string.
In the language of your choice, write a function to convert a native object to a json string.
A python example is provided below.
import json | |
sample_object = { | |
'name': 'BloomBoard', | |
'colors': ['red','blue','orange'], | |
'number': 42 | |
} | |
print(json.dumps(sample_object)) |
{"colors": ["red", "blue", "orange"], "name": "BloomBoard", "number": 42} |