toJSON

convert a associative array into a JSONValue object

Examples

Serialize an associative array.

1 auto json = ["a" : 1, "b" : 2, "c" : 3].toJSON;
2 assert(json.type == JSON_TYPE.OBJECT);
3 assert(json.object["a"].integer == 1);
4 assert(json.object["b"].integer == 2);
5 assert(json.object["c"].integer == 3);

Meta