JSONlibrary to handle JSON, not unlike the
Mathlibrary that we've used in Basics. In the following example, we show how a string containing JSON (e.g. one that might be read from a JSON file) can be converted to a JS Object with the built-in
JSON.parsemethod. Once converted, we can access the JSON data using regular JS Object syntax. If the outer-most data structure in the JSON string were an array,
JSON.parsewould return an array data structure instead.
stringifytakes an array or JS Object and turns it into a JSON string. This is useful for saving data to disk, because there is no way to directly write an array or JS Object to a file without first converting it to string format.
stringifymethods in the Chrome DevTools console. Verify they do what you expect.