Notes On ...

JSON

JSON (JavaScript Object Notation) is a data interchange format, based on a subset of the JavaScript 🗒️ scripting language standard 🌐. Its created purpose was to be a format that was easy for humans to read and write, and accomplishes this by being built on two common programming structures:

  1. A Collection of Name/Value Pairs — known in most languages as an:

  2. An Ordered List of Values — known in most languages as:

Its use is very common across data interchange, but especially between web applications and servers. This means that although JSON is based on JavaScript, it is completely language independent. Many programming languages provide methods / libraries to generate or parse JSON-format data.

Syntax

Universal Syntax:

Parser Dependent: (only available in some parsers)

For general use, it is considered best practice to stick to universal JSON syntax rules to avoid parser errors or bugs.

Example

aboutMe.json

{
  "firstName": "Gesty",
  "lastName": "Linaga",
  "location": {
    "Country": "United States",
    "State": "California",
  },
  "hobbies": [
    { 
      "hobby": "surfing",
      "category": "physical"
    },
    {
      "hobby": "coding",
      "category": "creative"
    }
  ],
  "instrumentsIPlay": [
    "bass",
    "guitar",
    "drums...sometimes"
  ]
}