What is JSON?
- 1. JSON stands for JavaScript Object Notation.
- 2. It is data-only format to represent values and objects.
- 3. It is used to transfer data between applications through APIs.
- 4. JSON keys must be strings enclosed in double quotes.
- 5. It supports six data types: object, array, string, number, boolean, and null.
- 6. It supports nested structures, allowing objects and arrays to be nested within
each other.
JSON Methods
JSON.stringify(value)
- 1. JSON.stringify() is a method that converts a JavaScript object or value into a JSON string.
- 2. Returns JSON.
- 3. It does not support: function properties, symbolic keys and values, and properties that store undefined.
JSON.parse(value)
- 1. JSON.parse() is a method that converts JSON string into JavaScript object or value.
- 2. Returns plain JavaScript object.