toJSON

convert a set of heterogenous values into a JSONValue array

Examples

Serialize a heterogenous array.

1 auto json = toJSON(1, "hi", 0.4);
2 assert(json.type == JSON_TYPE.ARRAY);
3 assert(json.array[0].integer  == 1);
4 assert(json.array[1].str      == "hi");
5 assert(json.array[2].floating == 0.4);

Meta