Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme.md #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions step00a_json_objects/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

}

But wait, Is JSON is similar to javaScript objects?
But wait, is JSON similar to javaScript objects?

The Answer is No.

1. JavaScript objects can contain functions but JSON not.
1. JavaScript objects can contain functions but JSON can not.
2. JavaScript objects can only be used in JavaScript but JSON can be created and used by other programming languages.


## JSON Data

1. JSON data consists of key/value pairs similar to JavaScript object properties.
2. The key and values are written in double quotes separated by a :.
3. Example :
2. The key and values are written in double quotes separated by a "."
3. Example:

// JSON data

Expand All @@ -38,7 +38,7 @@ The Answer is No.

1. The JSON object is written inside curly braces { }.
2. JSON objects can contain multiple key/value pairs.
3. Example :
3. Example:

// JSON object

Expand All @@ -47,27 +47,27 @@ The Answer is No.
## JSON Array

1. JSON array is written inside square brackets [ ].
2. Example :
2. Example:

// JSON array

[ "Vipin", "Ankit", "Raj"]

## Accessing JSON Data

1. We can access JSON data using the dot notation.
2. Example :
1. We can access JSON data using dot notation.
2. Example:

// JSON object

const detail = { "name": "Vipin", "age": 21 }

// accessing JSON object

console.log(detail. name); // Vipin
console.log(detail.name); // Vipin

3. We can also use square bracket syntax [] to access JSON data.
4. Example :
4. Example:

// JSON object

Expand All @@ -83,9 +83,10 @@ The Answer is No.
console.log(detail["age"]); // Vipin

## Use of JSON

1. JSON is the most commonly used format for transmitting data (data interchange) from a server to a client and vice-versa.
2. JSON data are very easy to parse and use.
3. JSON is language independent(We can create and use JSON in other programming languages too).
2. JSON data is very easy to parse and use.
3. JSON is language independent (We can create and use JSON in other programming languages too).

## Examples of JSON

Expand Down