JSON files and JSON objects

Source: Internet
Author: User

JSON Syntax RulesThe JSON syntax is a subset of the JavaScript object representation syntax.
    • Data in key-value pairs
    • Data is separated by commas
    • Curly braces Save Object
    • Square brackets Save Array
JSON name/value pairsThe writing format for JSON data is: name/value pairs. Names in name/value pairs are written in front (in double quotes), value pairs are written behind (also in double quotes), separated by colons:
1 "firstName":"John"
This is easy to understand and is equivalent to this JAVASCRIPT statement:
1 firstName="John"
JSON ValueThe JSON value can be:
    • Number (integer or floating point)
    • String (in double quotes)
    • Logical value (TRUE or FALSE)
    • Array (in square brackets)
    • Object (in curly braces)
    • Null

JSON object is JS object-oriented target, prototype JS Object-oriented Foundation
The writing format for/*json data is: name/value pairs. The difference between the JSON in C + + and the format written by the JSON object in JS:
The names of keys in C + + are enclosed in double quotes, and JS does not require
Names in name/value pairs are written in front (in double quotes), value pairs are written behind (also in double quotes), separated by colons:
1
"FirstName": "John"
This is easy to understand and is equivalent to this JAVASCRIPT statement:
1
Firstname= "John"
*/

JSON files and JSON objects

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.