What is JSON?
JSON stands for JavaScript Object Notation. It's a lightweight data interchange format. It is a syntax for storing and exchanging data. It’s text written with javascript object notation. In this article, we will see some basics of JSON with JavaScript.
History of JSON
JSON is a human-readable text to transmit data object consisting of attribute-value pairs and array data types (or another serializable value). It is considered as a replacement for XML and AJAX-style system. It’s a language independent format and it’s derived from JavaScript and also include many languages to generate parsed JSON. Any JSON file saved with an extension of .json is used to transfer data between server and web application.
In the year 2000 Douglas Crock Ford originally specified the JSON Format. At that time, two competing standards, RFC 8529 and ECMA-404, were the ECMA's only defined allowed syntax and RFC covers some security and interoperability consideration.
Advantages of JSON
Here are some of the advantages of JSON:
- It’s easy for a human to read and it’s lightweight.
- It’s language independent.
- It’s can be easy to store application data and similar with XML.
- It’s faster and it’s very easy to use.
- It has a wide range of support browser compatibility with the operating system.
- It’s the best tool for sharing data.
But there is no error handling in JSON.
JSON vs XML
JSON is easy to read,
- It is data-oriented
- It’s doesn’t provide display capabilities.
- Its supports array
- It supports only text and numbers
XML
- XML’s less easy to learn.
- It is document-oriented.
- It provides data to display because it’s a markup language.
- It doesn’t support array.
- It supports text, numbers, images, and graphs.
Important terms in JSON:
Key
Key in JSON is defined as always a string enclosed in a quotation mark
Value
A value can be a string, number or Boolean.
JSON object
An object is a real-world entity and it’s an instance of the class. It contains name and value separated by colons and is enclosed by curly braces. Each pair is separated by a comma.
Syntax for object


Join the conversation! Your thoughts help the community grow.