You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+97-4Lines changed: 97 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ This course/Tutorial is for anyone and everyone, Almost everyone!
36
36
37
37
Why learn JSON
38
38
---------------------
39
-
JSON stands for JavaScript Object Notation is text-based and human-readable. JSON has become a widely accepted and popular format for data due to its platform-neutral nature, lightweight format, and it’s the ability to convert directly to native JavaScript Objects. JSON is being used everywhere from Web APIs to noSQL databases, to server-side language libraries and client-side frameworks.
39
+
JSON stands for JavaScript Object Notation is text-based and human-readable. JSON has become a widely accepted and popular format for data due to its platform-neutral nature, lightweight format, and it’s the ability to convert directly to native JavaScript Objects. JSON is being used everywhere from Web APIs to NoSQL databases, to server-side language libraries and client-side frameworks.
40
40
41
41
JSON has significantly improved server-to-browser communications, especially when it comes to AJAX. JSON is better than XML and more popular! Easily exchange data between client and server applications. JSON is easy to use and built for storing and exchanging data.
42
42
@@ -74,9 +74,12 @@ Topics included/covered
74
74
- 1.3. [What JSON is not?](#13-what-json-is-not)
75
75
- 1.4. [Usage of JSON](#14-usage-of-json)
76
76
- 1.5. [Characterstics of JSON](#15-characterstics-of-json)
77
+
- 1.6. [JSON Syntax](#16-json-syntax)
78
+
- 1.7. [JSON vs XML](#17-json-vs-xml)
77
79
80
+
<!--
78
81
2. [JSON Resources](#2-json-resources)
79
-
82
+
-->
80
83
81
84
1 Introduction to JSON
82
85
=====================
@@ -114,7 +117,7 @@ JSON uses, follows and based on Object Literal Notation syntax of JavaScript. JS
114
117
- JSON is easy to use and built for storing and exchanging data
115
118
- Since the JSON format is text only, it can easily be sent to and from a server and used as a data format by any programming language
116
119
117
-
JSON has become a widely accepted and popular format for data due to its platform-neutral nature, lightweight format, and it’s the ability to convert directly to native JavaScript Objects. JSON is being used everywhere from Web APIs to noSQL databases, to server-side language libraries and client-side frameworks.
120
+
JSON has become a widely accepted and popular format for data due to its platform-neutral nature, lightweight format, and it’s the ability to convert directly to native JavaScript Objects. JSON is being used everywhere from Web APIs to NoSQL databases, to server-side language libraries and client-side frameworks.
118
121
119
122
JSON has significantly improved server-to-browser communications, especially when it comes to AJAX. JSON is better than XML and more popular! Easily exchange data between client and server applications. JSON is easy to use and built for storing and exchanging data.
120
123
@@ -139,6 +142,7 @@ JSON is programming language independent Data Interchange Format - an only text-
139
142
- It is primarily used to transmit data between a server and web applications (client and server)
140
143
- Web services and APIs use JSON format to provide public data
141
144
- It can be used with different platform-independent modern programming languages
145
+
- JSON is used in Web APIs as well as NoSQL databases
142
146
143
147
1.5. Characteristics of JSON
144
148
---------------------
@@ -148,5 +152,94 @@ JSON is programming language independent Data Interchange Format - an only text-
148
152
- JSON is language independent
149
153
- JSON uses, follows and based on Object Literal Notation syntax of JavaScript
150
154
- JSON is widely used to exchange, send and receive data from server to client and vice versa
151
-
- JSON represent data in the pair of Curley braces and in the form of key-value pairs ie property and data e.g. ` var Employee = { "employeeName": "Dinanath", "employeeId": "101"} `
155
+
- JSON represent data in the pair of Curley braces and in the form of key-value pairs ie property and data e.g. ` var Employee = { "employeeName": "Dinanath", "employeeId": "101", "empId": 101} `
152
156
- Transfer data easily between Server and Client
157
+
158
+
1.6. JSON Syntax
159
+
---------------------
160
+
161
+
- JSON syntax is very simple and uses `name : value pair` or `key : value pair`
162
+
163
+
The JSON syntax is a subset of the JavaScript syntax. JSON syntax is derived from JavaScript object notation syntax:
164
+
- Data is in name/value pairs
165
+
- Data is separated by commas
166
+
- Curly braces hold objects
167
+
- Square brackets hold arrays
168
+
169
+
JSON format starts with `curley brace/bracket {` and `ends with curley brace/bracket }`. In-between curley brace we can put `"name" and value` or `"key":value` or `"property":value/data` pair, every property of the object is seperated by comma.
170
+
171
+
JSON represents data in the `pair of curly braces and in the form of key-value pairs ie property and data`. We can separate `Property Name` with the help of `colon:` then specify `property Value` and multiple properties are separated with `comma,`.
172
+
173
+
```
174
+
175
+
- JSON, keys must be strings, written with "double quotes", JavaScript names don't.
176
+
177
+
```
178
+
179
+
To access or read data from a JSON object, we simply need to use property name with `. dot notation`, will get all IntelliSense as soon as will use any jsonObjectName.propertyName i.e. JsonObjectName.propertyName or so.
180
+
181
+
As soon as we assign JSON format/values to any JavaScript variable, it becomes a JavaScript object to which we can access via `. dot notation`.
182
+
183
+
### 1.6.1. JSON Values
184
+
In JSON, values must be one of the following data types:
0 commit comments