ScanSkill

JSON

JSON, or JavaScript Object Notation, is a standard data interchange format for text-based data transmission and storage. Other serialization formats, including XML, are quite comparable to it in terms of functionality.

JSON's moniker comes from how closely its notation resembles JavaScript's data types.

How data is encoded in JSON?

  • object: a collection of key-value pairs, enclosed in { }
  • array: an ordered list of values, enclosed in [ ]
  • string: an ordered sequence of text, enclosed in " "
  • number: a numeric value expressed in decimal, with exponent notation allowed
  • boolean: true or false
  • null: lack of a value

Example

{
  "company": {
    "name": "Cloudyfox",
    "login": "cloudyfoxlabs"
  },
  "repo": {
    "name": "internal-server-conf",
    "activelyMaintained": true,
    "stats": [
      {
        "type": "stars",
        "count": 20  
      },
      {
        "type": "forks",
        "count": 50 
      }
    ]
  }
}