# Data Types

The following table lists the JSON basic types:

Data Type | Description
--- | ---
Array | An ordered collection of values
Boolean | A logical data type that is either `true` or `false`
Number | A numeric value in double precision floating-point format
Object | An unordered collection of key:value pairs
String | A sequence of characters
`true` | Indicates the boolean value true (used with Boolean)
`false` | Indicates the boolean value false (used with Boolean)
`null` | Indicates no value

Note: The literal names MUST be lowercase.

# Array

An array is an ordered collection of values.

## Syntax

Begins With: Left Bracket ('[')
Ends With: Right Bracket (']')
Values are separated by a comma (',') character.

## Examples

    [
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday",
      "Saturday",
      "Sunday"
    ]

    "items":
    [
      {
        "name": "first item",
        "price": "10.00"
      },
      {
        "name": "second item",
        "price": "20.00"
      }
      {
        "name": "third item",
        "price": "30.00"
      }
    ]

    [
      [1, 0, 0],
      [0, 1, 0],
      [0, 0, 1]
    ]

# Boolean

A Boolean is a logical data type that is either `true` or `false`.

## Syntax

A Boolean is defined by specifying the 'name' in double-quotes ("), followed by a colon (:), followed by the value `true` or `false`.

Note: Key/value pairs are separated by a comma (',') character.

## Examples

    "enabled": true,
    "isOpen": false

# Number

A numeric value in double precision floating-point format.

## Syntax

A Number is defined by specifying the 'name' in double-quotes ("), followed by a colon (:), followed by the value. The value has an integer component that may be prefixed with an optional minus sign, which may be followed by a fraction part and/or an exponent part.

A fraction part is a decimal point followed by one or more digits.

An exponent part begins with the letter E in upper or lowercase, which may be followed by a plus or minus sign. The E and optional sign are followed by one or more digits.

Note: Key/value pairs are separated by a comma (',') character.

Note: Leading zeros are not allowed.

Note: Hexidecimal and Octal forms are not allowed.

## Examples

    "age": 25,
    "price": 123.45,
    "Area":123.45e2

# Object

An object is an unordered collection of key:value pairs.

## Syntax

Begins With: Left Brace ('{')
Ends With: Right Brace ('}')
Key/value pairs are separated by a comma (',') character.

## Examples

This example is a JSON object that includes a string "header" and an array of objects "items":

    {
      "menu": {
        "header": "Main Menu",
        "items": [
            {"id": "Products"},
            {"id": "Support"},
            {"id": "About US"},
        ]
      }
    }

# String

A string is a sequence of characters.

## Syntax

A string begins and ends with quotation marks. All Unicode characters may be placed within the quotation marks except for the characters that must be escaped: quotation mark, reverse solidus, and the control characters (U+0000 through U+001F).

Note: Key/value pairs are separated by a comma (',') character.

## Examples

    "header": "Main Menu",
    "First Name": "Joe",
    "Last Name": "Smoe",