JSON module
let test = {"name": "John", "age": 30, "car": null};Serializing JSON
let test = {"name": "John", "age": 30, "car": null};
let jsonData = JSON.serialize(test); // jsonData has type text
return jsonData.let addOne = function (x: number) => x + 1;
let recordContaningFunction = {f: addOne};
return JSON.serialize(recordContaningFunction); // ERROR: Function values cannot be converted to JSON.Deserializing JSON
Narrow deserialization
Last updated
Was this helpful?