Json - Representation


Json - Representation

JSON Files:

  • JSON File type - ".json"
  • JSON MIME type - "application/json"

Object :

Javascript:
var tutorial = { 
    name: "wikitechy-object", 
technology : 18
};
	JSON:
{ 
    "name": "wikitechy-object",
    "technology": 18
}

Updates in JSON :

  • No trailing semicolon. 
  • Quotes required with property name. 
  • Value can be simple or complex as follows:
{ 
    "name": "wikitechy-object",
    "technology": 18
    "topic": {
         "name": "learn json", 
         "content": "json basics" 
     } 
}

JSON Arrays :

  • Represented in literal form in JSON.

1. JavaScript Array :

var values = [1, "wikitechy”, true];

2. JSON Array :

[1, "wikitechy", true]

3 .Complex Arrays and objects Collection:

{ 
[
{
    "name": "wikitechy-object1",
    "technology": 18
    "topic": {
         "name": "learn json", 
         "content": "json basics" 
     } 
},
{
     "name": "wikitechy-object2",
"technology": 18
"topic": {
"name": "learn json",
"content": "json basics"
} } ] }