JSON (JavaScript Object Notation) is a lightweight, text-based, human-readable data interchange format designed to simplify the transfer and storage of structured data. It has become the standard in modern APIs, often replacing XML ab.
Definition
As an abbreviation for JavaScript Object Notation defined JSON a platform-independent format for representing data objects consisting of attribute-value pairs. It is completely language-independent but is based on the syntax of JavaScript and can be easily generated and parsed by computers.
Structure and Data Types
The structure of JSON based on two fundamental types: a collection of name/value pairs (commonly referred to as an object, record, struct, hash table, or associative array) and an ordered list of values (array, vector, list, or sequence). It supports several fundamental data types.
- Objects: An unordered collection of name/value pairs, enclosed in curly braces `{}`.
- Arrays: An ordered collection of values, enclosed in square brackets `[]`.
- Values: Can be strings, numbers, booleans (`true`, `false`), `null`, objects, or arrays.
- Strings: Sequences of Unicode characters enclosed in double quotes.
Application areas
JSON is primarily used for data exchange between servers and web applications (AJAX), in RESTful APIs and is used for configuring applications. Its simple syntax and efficiency have made it the preferred format for transferring structured data on the web.