JSON consists of key-value pairs, where the key is a string and the value can be a string, number, boolean, null, object or array. It is often used for transmitting data between a web server and a web application, as well as between different parts of a web application. JSON has become a popular alternative to XML as a data format, especially in web-based applications, due to its simplicity and ease of use.
JSON is built around two fundamental structures:
An unordered collection of key/value pairs is what this is (i.e. key:value). Each item has a left curly bracket at the start and a right curly bracket at the conclusion. There are spaces between each key/value pair.
An ordered list of values is what this is. Left and right brackets are used to start and terminate an array, respectively. A comma is used to separate values.
While the value in JSON can be any of the following: a text, integer, true or false, null, object, or even an array, the property names or keys are always strings. Strings can contain escape characters like \n, \t, and \ must be contained in double quotes.