0% found this document useful (0 votes)
6 views

Handling JSON In JavaScript ?

JSON (JavaScript Object Notation) is a lightweight format for storing and transporting data, commonly used for communication between servers and web pages. It consists of name/value pairs and can be represented as objects enclosed in curly braces or arrays in square brackets. Conversion between JSON and JavaScript objects is done using JSON.parse() and JSON.stringify() methods.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Handling JSON In JavaScript ?

JSON (JavaScript Object Notation) is a lightweight format for storing and transporting data, commonly used for communication between servers and web pages. It consists of name/value pairs and can be represented as objects enclosed in curly braces or arrays in square brackets. Conversion between JSON and JavaScript objects is done using JSON.parse() and JSON.stringify() methods.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

AAKASH

aakash-n0dev

Handling JSON

JAVASCRIPT
Introduction to JSON

JSON (JavaScript Object Notation) is


a lightweight data interchange format
used for storing and transporting
data.

It’s often used when data is sent from


a server to a web page.

JSON is language-independent, self-


describing, and easy to understand.
JSON Syntax

JSON data consists of name/value


pairs, similar to JavaScript object
properties.

A name/value pair includes a field


name (in double quotes), followed by
a colon and the corresponding value.

Unlike JavaScript, JSON names


require double quotes.
JSON Objects

JSON objects are enclosed in curly


braces {}.

Objects can contain multiple


name/value pairs.
JSON Arrays

JSON arrays are enclosed in square


brackets [].
An array can contain objects.
Converting JSON to Js Object
& Js Object to JSON

To convert a JSON string to a JavaScript object, use


JSON.parse().

To convert a JavaScript object to JSON format, use


JSON.stringify().
JS code to handle JSON data
from an API

You might also like