Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

JSON Array


JSON array represents ordered list of values. JSON array can store multiple values. It can store string, number, boolean or object in JSON array.

In JSON array, values must be separated by comma.

The [ (square bracket) represents JSON array.

JSON Array of Strings

Let’s see an example of JSON arrays storing string values.

  1. [“Sunday”“Monday”“Tuesday”“Wednesday”“Thursday”“Friday”“Saturday”]

JSON Array of Numbers

Let’s see an example of JSON arrays storing number values.

  1. [1234564395]

JSON Array of Booleans

Let’s see an example of JSON arrays storing boolean values.

  1. [truetruefalsefalsetrue]

JSON Array of Objects

Let’s see a simple JSON array example having 4 objects.

  1. {“employees”:[
  2.     {“name”:“Ram”“email”:“ram@gmail.com”“age”:23},
  3.     {“name”:“Shyam”“email”:“shyam23@gmail.com”“age”:28},
  4.     {“name”:“John”“email”:“john@gmail.com”“age”:33},
  5.     {“name”:“Bob”“email”:“bob32@gmail.com”“age”:41}
  6. ]}

JSON Multidimensional Array

We can store array inside JSON array, it is known as array of arrays or multidimensional array.

  1. [
  2.  [ “a”“b”“c” ],
  3.  [ “m”“n”“o” ],
  4.  [ “x”“y”“z” ]
  5. ]

Comments

comments