{"id":256,"date":"2018-04-30T17:17:41","date_gmt":"2018-04-30T17:17:41","guid":{"rendered":"https:\/\/restfulapi.net\/?p=256"},"modified":"2021-09-27T23:10:39","modified_gmt":"2021-09-27T17:40:39","slug":"json-data-types","status":"publish","type":"post","link":"https:\/\/restfulapi.net\/json-data-types\/","title":{"rendered":"JSON Data Types"},"content":{"rendered":"\n

At the granular level, JSON consists of 6 data types. <\/p>\n\n\n\n

The first four data types (string, number, boolean and null) can be referred to as simple data types<\/strong>. The other two data types (object and array) can be referred to as complex data types<\/strong>.<\/p>\n\n\n\n

  1. string<\/li>
  2. number<\/li>
  3. boolean<\/li>
  4. null\/empty<\/li>
  5. object<\/li>
  6. array<\/li><\/ol>\n\n\n\n

    Let’s learn about each data type one by one.<\/p>\n\n\n\n

    1. String<\/h3>\n\n\n\n

    A string is a sequence of zero or more Unicode characters, enclosed between \"<\/code> and \"<\/code> (double quotes). Strings wrapped in single quotes '<\/code> are not valid.<\/p>\n\n\n\n

    {\r\n    \"color\" : \"Purple\"\r\n}<\/code><\/pre>\n\n\n\n

    JSON Strings can contain the following backslash-escaped characters:<\/p>\n\n\n\n