What is JSON?
Javascript Object Notation (JSON) is a text-based format for expressing structured data consisting of attribute-value pairs, arrays, or other serializable values.
Originally based on the Javascript programming language, JSON is language-independent but follows some of the same conventions as widely known languages like C, C++, Javascript, Java, Python, and others. Not only is JSON easy for humans to read and write, but code for parsing and generating JSON currently exists in many programming languages. These properties have made JSON the world’s most popular data exchange language over the past decade.
The JSON format was created by Douglas Crockford in the early 2000s, with the first JSON message sent over the Internet in April 2001. Since then, billions of messages have been written, generated, and transmitted in JSON format.
How Does JSON Work?
JSON is built on two main data structures: objects and arrays.
An array is simply an ordered list of values, while an object is a collection of attribute/value pairs.
Example 1: Simple Data in JSON
Here’s a simple example of how we can represent some data in JSON format. The following table gives information about three employees that work at ACME Company: