JavaScript Object Notation (JSON)


JavaScript Object Notation (JSON) is a file format that uses attribute-value pairs to define configurations in a structure that is easy for both humans and machines to read and consume.

  • object-oriented, event-driven programming language that enables website interaction
  • is a derivative of JavaScript
  • uses key/value pairs
  • can use an array (list of elements)
    • noted using square brackets and contains comma-separated elements

Comparing JSON and XML

  • Both utilize tags or keys created by the developer
    • thus more relevant to the data
  • can both be read, parsed, and used by many programming languages
  • JSON has a more simplified coding syntax than XML
    • is not considered a markup language because it is object-oriented
  • JSON can use arrays, whereas XML cannot

Example

{ "Product Info" :
	{
		"Products": [
		{
			"Product Name": "Adjustable Race",
			"Product Number": "AR-5381",
			"Product Price": 5.00,
		},
		{
			"Product Name": "Bearing Ball",
			"Product Number": "BA-8327",
			"Product Price": 4.50,
		},
			]
	}
}