0% found this document useful (0 votes)
2 views2 pages

JSON+Data+Types+Handout

This document provides an overview of JSON data types including string, boolean, number, null, array, and object. It highlights key characteristics and differences between these types, such as the lowercase requirement for boolean and null values, and the distinction between arrays and objects. An example JSON object is also included to illustrate the concepts discussed.

Uploaded by

vwhtwn9n4c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

JSON+Data+Types+Handout

This document provides an overview of JSON data types including string, boolean, number, null, array, and object. It highlights key characteristics and differences between these types, such as the lowercase requirement for boolean and null values, and the distinction between arrays and objects. An example JSON object is also included to illustrate the concepts discussed.

Uploaded by

vwhtwn9n4c
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JSON Data Types Handout

Key Terms:

JSON String Data Type: a string value, like “my string” surrounded in double quotes.

JSON Boolean Data Type: a true or false value.

JSON Number Data Type: a number value, like 42, that can be a positive or negative integer,
decimal, or exponent.

JSON Null Data Type: A null value represents an empty value.

JSON Array Data Type: An array is a collection or list of values and the values can have a data
type of string, number, boolean, object or array. The values in an array are surrounded by
square brackets([]) and delimited by a comma.

JSON Object Data Type: The object data type is a set of name/value pairs delimited by a
comma and surrounded by curly brackets ({}).

Key Points:

● The boolean data type value of true or false in JSON is always all lowercase characters
(like true, not True).
● The key difference between null in JSON and undefined in JavaScript is that null
represents an empty value and undefined represents and empty property and value (or
name/value pair).
● The null data type value in JSON is always all lowercase characters (like null, not NULL
or Null).
● One key difference between an object and an array is that an object is a list or collection
of name/value pairs where an array is a list or collection of values.
● Another key difference between an array and an object is that an array’s values *should*
all have the same data type.

Example:
{
"name": "Marie",
"age": 32,
"nickname": null,
"instructor": true,
"favorites": {
"color": "green",
"number": 5
},
"numbers": [
1,
2,
3
]
}

You might also like