Reading:  

Getting start with JSON


Support JSON Data types

JSON supports six data types:  

  • Primitive Types
    • String
    • Number
    • Boolean
    • Null 
  • Structure Type
    • Object
    • Array

 

Here is our data type hierarchy 

JSON data types

 

The supported data types with respective examples and definitions are highlighted in the table below

 

Number
{ "myNos": 16.56 }

A number value, can be a floating point or integer

 

String
{ "myStrings": "abcdef" }

It is series of characters (numbers, symbols or letters)

Boolean
{ "myBools": false }

True or false

 

Array
{ "myArray": [ "a", "b", "c", "d" ] }

Sequence of comma-separated values (any data type), enclosed in square brackets.

 

Object
{ "myObjects": { "id": 8 } }

Unordered collection of comma-separated key/value pairs, enclosed in curly braces, properties (keys) are distinct strings.

 

Null
{ "myNulls": null }

Variable with null (empty) value.

  

 

The Unsupported Data Types are:

 

Undefined  var myUndefined;

Variable with no value assigned.

 

Regular Expression var myRegEx = /json/i;

Variable containing a sequence of characters that form a search pattern.

 

 In the next part of this tutorial we will quickly get through JSON Objects

Description

In this tutorial you will learn 

  1. What is JSON
  2. Syntax
  3. Datatypes with JSON
  4. Objects
  5. Schema
  6. XML vs JSON
  7. Using with PHP and Java

This tutorial is a quick walkthrough over the technology

 



Learning Objectives

Objective of this tutorial is to give you enough information on JSON to get you started with the technology

Author: Subject Coach
Added on: 20th Jul 2015

You must be logged in as Student to ask a Question.

None just yet!