JSON: Examples
The JSON module provides methods for transforming data between native JavaScript objects and their JSON string equivalent.
- JSON with Y.io: Use JSON to parse data received via XMLHttpRequest via Y.io calls — a simple JSON use case.
- Rebuilding Class Instances from JSON Data: Use the replacer and reviver parameters to reconstitute object instances that have been serialized to JSON.
- Adding New Object Members During Parsing: Use a currency conversion calculation to add a new price member to a JSON response, demonstrating how JSON data, once retrieved, can be transformed during parsing.