concept JSON in category coffeescript

appears as: JSON, JSON
CoffeeScript in Action

This is an excerpt from Manning's book CoffeeScript in Action.

This format is called JavaScript Object Notation (JSON). Being the language of the web, JavaScript’s syntax for representing structured data has become a popular format for data interchange on the web. JSON is a subset of the literal syntax for objects in JavaScript. This means that valid JSON is a valid object literal in JavaScript and in CoffeeScript. But not every valid object literal is valid JSON. You can expect many web services to offer JSON as one of the supported data formats they provide.

If you find yourself stuck writing programs for a browser that doesn’t support the ECMAScript 5 feature that you want, you will need to polyfill. Sometimes you need to polyfill things you might think are essential, such as JSON.

ECMAScript 5 introduced the global JSON object and the JSON.stringify and JSON .parse methods. What do they do, and why can’t you just use JSON directly in your programs? After all, valid JSON is a valid JavaScript object.

JSON.stringify @
# TypeError: Converting circular structure to JSON

What can you do? Formulaic is your class, so surely you can tell it how to turn itself into JSON? Indeed, you can. Even better, you can tell JSON.stringify about it.