JSON is a lightweight data interchange format used to describe data structures. It is based on a text format that is easy to parse and generate.
JSON has two structures
JSON, in simple terms, is the objects and arrays in JavaScript, so these two structures are objects and arrays. These structures can represent various complex structures.
1. Object: An object in JavaScript is represented by content enclosed in "curly braces" {}, with a data structure of {key: value, key: value, ...}, which is a key-value pair structure. In object-oriented languages, the key is the property of the object, and the value is the corresponding property value. It is easy to understand, and the method to retrieve the value is object.key to get the property value. The type of this property value can be a number, string, array, or object.
2. Array: An array in JavaScript is represented by content enclosed in "square brackets" [], with a data structure of ["java", "javascript", "vb", ...]. The way to retrieve values is the same as in all languages, using an index to get it, and the field value type can be a number, string, array, or object. With objects and arrays, two structures can be combined to form complex data structures.