JSON basic structure

Source: Internet
Author: User

JSON basic structure

JSON: JavaScript Object Notation (JavaScript object Notation) is the syntax for storing and exchanging textual information. Similar to XML. Smaller, faster, and easier to parse than XML. JSON takes a completely language-independent text format, but also uses a similar idiom to the C language family (c, C + +, C #, Java, JavaScript, Perl, Python, etc.). These features make JSON an ideal data exchange language. Easy to read and write, but also easy to machine parse and build (network transfer speed).

the JSON value can be in the form of:
    • Number (integer or floating point)
    • String (in double quotes)
    • Logical value (TRUE or FALSE)
    • Array (in square brackets)
    • Object (in curly braces)

JSON is simply called objects and Arrays in JavaScript, so these two structures are objects and arrays of two structures that can represent a variety of complex structures

1. Object: Object in JS is represented as "{}" in the content, data structure is {Key:value,key:value,...}    The structure of key-value pairs, in object-oriented languages, key is the property of the object, value is the corresponding property value, so it is easy to understand that the value method is the object. Key Gets the property value, the type of the property value can be a number, a string, an array, several objects. 2. Array: The array in JS is the bracketed "[]" content, the data structure is ["Java", "JavaScript", "VB",...], the value way and all languages, using index get, the type of field value can be number, string, array, object several. Through the object, the array 2 kinds of structure can be combined into a complex data structure.       

JSON basic structure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.