JSON (JavaScript Object Notation) is a lightweight data exchange format. Easy for humans to read and write. It is also easy for machines to parse and generate. It is based on JavaScript Programming Language, a subset of Standard ECMA-262 3rd Edition - December 1999. JSON uses a completely language-independent text format, but also uses conventions similar to the C language family (including C, C, C#, Java, JavaScript, Perl, Python, etc.). These properties make JSON an ideal data exchange language.
JSON is constructed from two structures:
1. A collection of name/value pairs. In different languages, it is understood as an object, a record, a struct, a dictionary, a hash table, a keyed list, or an associative array. array).
2. An ordered list of values. In most languages, it is understood as an array.
These are common data structures. In fact most modern computer languages support them in some form. This makes it possible for a data format to be exchanged between programming languages that are also based on these structures.
JSON has the following forms:
•An object is an unordered collection of name/value pairs. An object starts with "{" (left bracket) and ends with "}" (right bracket). Each "name" is followed by a ":" (colon); "name/value" pairs are separated by a "," (comma).
•An array is an ordered collection of values. An array starts with "[" (left bracket) and ends with "]" (right bracket). Values are separated by "," (comma).
•Value can be a string, number, true, false, null, object or array enclosed in double quotes. These structures can be nested.
• A string is a collection of any number of Unicode characters surrounded by double quotes and escaped with backslashes. A character is a single character string.
•Strings are very similar to C or Java strings.
•Numbers are also very similar to C or Java numbers. Remove unused octal and hexadecimal formats. Removed some encoding details.
•White space can be added between any symbols. The complete language is described below.
JSON example (using json in javascript):