make an object JSON code example
Example 1: python class json serializable
import json
class Object:
def toJSON(self):
return json.dumps(self, default=lambda o: o.__dict__,
sort_keys=True, indent=4)
Example 2: create a json object in javascript
var employee = {
"firstName": firstName,
"lastName": lastName
}