1 min read

JavaScript JSON | Data Types

JavaScript Object Notation is a format for structuring data which is used for storing and transporting the data as well as it is easy to read and write.
JavaScript JSON  | Data Types

JSON (JavaScript Object Notation) is most widely used data format for data interchange on the web. JSON is a lightweight text based, data-interchange format and it completely language independent.

Like XML, it is one of the way of formatting the data. Such format of data is used by web applications to communicate with each other. But it is simpler to read and write when compared to XML.

It is Language independent..

JSON supports mainly 6 data types:
1. Array: An associative array of values. [ value, .......]

2. Boolean: True or false.

{ "result" : true }

3. Number: An integer.

{ "age": 20 } { "percentage": 82.44}

4. Object: An associative array of key/value pairs.

{ "Geek":{ "name":"Peter", "age":20, "score": 50.05} }

5. String: Several plain text characters which usually form a word.

{ "name":"Vivek" }        

6.null  { "result" : true, "grade" : null, "rollno" : 210 }

Example of JSON document

"Avengers": [

"Avengers": [

	"Name" : "Tony stark",
	"also known as" : "Iron man",
	"Abilities" : [ "Genius", "Billionaire",
					"Playboy", "Philanthropist" ]

	"Name" : "Peter parker",
	"also known as" : "Spider man",
	"Abilities" : [ "Spider web", "Spidy sense" ]


JSON | Data Types - GeeksforGeeks
A computer science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

#JavaScript #Object #JSON #Format #Probyto #ProbytoAI

Subscribe and follow us for latest news in Data Science and Machine learning and stay updated!
Facebook: https://facebook.com/probyto
Twitter: https://twitter.com/probyto
LinkedIn: https://linkedin.com/company/probyto
Instagram: https://instagram.com/probyto