### JSON example Source: https://www.json.org/json-es.html A simple JSON object representing a person. ```json { "firstName": "John", "lastName": "Doe", "age": 30, "isStudent": false, "courses": [ { "title": "History", "credits": 3 }, { "title": "Math", "credits": 4 } ], "address": { "street": "123 Main St", "city": "Anytown", "zipCode": "12345" } } ``` -------------------------------- ### JSON Element Example Source: https://www.json.org/json-el.html A JSON element can be a string, number, boolean, null, object, or array. ```json { "name": "John Doe", "age": 30, "isStudent": false, "courses": null, "address": { "street": "123 Main St", "city": "Anytown" }, "hobbies": ["reading", "hiking"] } ``` -------------------------------- ### JSON syntax Source: https://www.json.org/json-fr.html A JSON text is a string of data and follows these rules: 1. A collection of name/value pairs (within curly braces `{}`). Called an **object**. 2. An ordered list of values (within square brackets `[]`). Called an **array**. 3. Values can be a string, a number, a boolean (`true`/`false`), an object, an array, or `null`. 4. Names must be strings, and values must be a valid JSON value, or a container value. That is, arrays or objects. 5. Strings are enclosed in double quotes. 6. One or more of the above elements may be arranged into a structure, or more typically, one element will be the root element that defines the information being conveyed by the data. Here are some examples of JSON syntax: ```json { "firstName": "John", "lastName": "Doe", "age": 30, "isStudent": false, "courses": [ { "title": "History", "credits": 3 }, { "title": "Math", "credits": 4 } ], "address": { "street": "123 Main St", "city": "Anytown", "zipCode": "12345" }, "spouse": null } ``` ```json { "firstName": "John", "lastName": "Doe", "age": 30, "isStudent": false, "courses": [ { "title": "History", "credits": 3 }, { "title": "Math", "credits": 4 } ], "address": { "street": "123 Main St", "city": "Anytown", "zipCode": "12345" }, "spouse": null } ``` -------------------------------- ### JSON structure Source: https://www.json.org/json-en.html A JSON text is a string of data and follows these rules: 1. It starts with an object or an array value. 2. It ends with an object or an array value. 3. It is built on two structures: a collection of name/value pairs an ordered list of values ```json { "firstName": "John", "lastName": "Doe", "age": 30, "isStudent": false, "courses": [ "Math", "Science" ], "address": { "street": "123 Main St", "city": "Anytown" } } ``` -------------------------------- ### JSON structure Source: https://www.json.org/json-ja.html A JSON text represents one of these two useful values: a collection of name/value pairs, or an ordered list of values. These are common programming data structures. JSON is built upon these. 1. An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma). 2. An array is an ordered sequence of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma). ```json { "firstName": "John", "lastName": "Doe", "age": 30, "isStudent": false, "courses": [ "Math", "Science" ], "address": { "street": "123 Main St", "city": "Anytown" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.