toJSON

convert a homogenous array into a JSONValue array

Examples

Serialize a homogenous array.

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

Meta