JavaScript Object Notation (JSON) is something that most JavaScript developers today are quite familiar with. Despite its name, JSON is a language-independent standard that is really just a text document, and it must first be parsed by JavaScript, or any language interpreter, before it can be used as data representing objects with name-value pairs, or as simple sequences of values.
The reason the JSON acronym includes the word JavaScript is because its formatting is based on the structure of JavaScript objects and arrays. This is why working with JSON data and JavaScript is so straightforward, and why it makes a lot of sense to consume JSON data from within JavaScript applications.
The contents of the user.json
file we created in
Chapter 2
, Model-View-Whatever is an example of the JSON data interchange format:
{ "id": 1, "name": { "first": "Philip", "last": "Klauzinski" }, "title": "Sr. UI Engineer"...