Datatypes in JSON

JSON supports six data types- Numbers, Strings, Booleans, Arrays, Objects, and null. Following table describes them in detail-

Data Type Description
Numbers It can be an integer or floating point
Strings Any Unicode characters placed inside double or single quotes.
Booleans It represents true or false
Arrays It is an ordered list of values separated by a comma enclosed in square brackets
Objects It is a collection of key:value pairs.
Null It means empty.


This illustration will show the usage of these data types-

	"name":"Black T-Shirt",
	"sizes":[32, 34, 36, 38],
		"name":"Stylish Shop",

Here name key contains string value, price key contains number value, sizes refer to an array, inStock points to boolean, seller is an object.