JSON Questions
JSON Questions
1. What is JSON?
JSON is a simple data exchange format. JSON means JavaScript Object Notation; it is language and
platform independent.
An object can be defined as an unordered set of name/value pairs. An object in JSON starts
with {left brace} and finish or ends with {right brace}. Every name is followed by: (colon) and
the name/value pairs are parted by, (comma).
"book": [
"id":"01",
"language": "Java",
"edition": "third",
},
"id":"07",
"language": "C++",
"edition": "second"
"author": "E.Balagurusamy"
⦁ Number
⦁ String
⦁ Boolean
⦁ Array
⦁ Object
⦁ Null
JSON.stringify() converts an object into a JSON text and saves that JSON text in a string.
⦁ When writing application based on JavaScript it uses JSON, which includes browser
extension and websites
⦁ JSON is used for transmitting and serializing structured data over network connection
⦁ JSON is mainly used to transfer data between server and web application
⦁ Web service and API’s use JSON format to provide public data
The fundamental difference, which no other answer seems to have mentioned, is that XML is
a markup language (as it actually says in its name), whereas JSON is a way of representing
objects (as also noted in its name). This is what makes markup languages so useful for
representing documents.
An array structure is a pair of square bracket tokens surrounding zero or more values. An
array is an ordered collection of values. An array begins with [ (left bracket) and ends with ]
(right bracket). Values are separated by , (comma).
The values are separated by commas. The JSON syntax does not define any specific meaning
to the ordering of the values. However, the JSON array structure is often used in situations
where there is some semantics to the ordering.