-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSyntax.jsonc
76 lines (57 loc) · 2.45 KB
/
Syntax.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
//? Syntax - Json
/* The syntax of Json - JavaScript Object Notation is quite simple and follows a set of clear rules
to represent structured data in a human-readable and easily interpretable format
machines. Here is a description of the basic Json syntax. */
//* 1. **Json Objects:**
/*
- A Json object is defined between curly braces `{}`.
- Key-value pairs within the object are separated by commas.
- Keys must be enclosed in double quotes.
- Key-value pairs consist of a key, followed by a colon (`:`), and a value.
- Objects can contain other nested objects.
*/
// Example of a Json object
"name": "John",
"age": 30,
"city": "Example",
// Example of a Json array
"array" : [
"apple",
"banana",
"orange"
]
//* 2. **Json Arrays:**
/*
- A Json array is defined between square brackets `[]`.
- The elements within the array are separated by commas.
- An array can contain any type of value, including other arrays and nested objects.
*/
//* 3. **Data Types:**
// - Json supports several data types:
/* - Numbers (example: `42` or `3.14`).
- Text strings (always enclosed in double quotes, example: `"Hello, world"`).
- Booleans (`true` or `false`).
- `null` (represents a null value).
- Objects (defined between curly braces `{}`).
- Fixes (defined in square brackets `[]`).
*/
//* 4. **Comments:**
/* Json does not support comments directly in its syntax. Comments should be handled outside of the
Json structure, in the code that uses it. */
//* 5. **Blank Spaces:**
/* Whitespace (spaces, tabs, line breaks) are ignored in Json syntax,
except within text strings. Indent formatting is a common practice to improve the
readability. */
//* 6. **Capital and Lowercase:**
/* Json is case insensitive, meaning `true` and `True` are considered
equals. */
//* 7. **Escape Special Characters:**
/* If you need to include special characters in a text string, such as double quotes or slashes
backslashes, you must escape them with a backslash (`\`). For example, `"string with \"quotes
doubles\""`. */
/* Json syntax is simple and easy to understand. It is important to ensure that the Json data is
well trained and comply with the aforementioned rules so that they are processed correctly by the
applications that use it. Automatic formatting and validation tools can be useful for
verify and maintain correct syntax in Json documents. */
}