Learn Json

Json Datatypes

Json support following datatypes.

  • Number :Double- precision floating -point format in JavaScript,generally depends on implementation.
  • String :A string is traditionally a sequence of characters.
  • Boolean :true or false.
  • Array: An ordered,comma-separated sequence of values enclosed in square brackets '[ ]'.
  • Object :An unordered, comma-separated collection of key:value pairs enclosed in curly braces '{ }'.'
  • null:empty.

Number Datatype Example

var obj = {price: 97}

String Datatype Example

var obj = {name: 'Manish'}

Boolean Datatype Example

var obj = {value: true}

Array Datatype Example

{
"book": [
{
"id":"21",
"language": "Json",
"edition": "second",
}]
}

Objects Datatype Example

{
"id":"21",
"language": "Json",
"edition": "second",
}

Null Datatype Example

var x = null;