JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language Standard ECMA-262 3rd Edition - December 1999.
JSON is built on two structures:
- A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
- An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
JSON Syntax
- Data is in name/value pairs
- Data is separated by commas
- Curly braces hold objects
- Square brackets hold arrays
Example
{
"name": "John Doe",
"age": 30,
"city": "New York"
}
Why Use JSON?
- It is language independent
- It is self-describing and easy to understand
- It is widely used for APIs and configuration files
For a deeper dive, check out the original article at tech-reader.blog.