Loading Please Wait...

Logo Lynxsia IT Solutions

JavaScript JSON Data Types

JS JSON Data Types

In JavaScript JSON values must be a valid data type.

Valid Data Types

In JSON, values must be one of the following data types:

  • a string
  • a number
  • an object (JSON object)
  • an array
  • a Boolean
  • null

JSON values cannot be one of the following data types:

  • a function
  • a date
  • undefined
JSON Strings

Strings in JSON must be written in double quotes.

					 
        
          {"name":"John"}
        
      
JSON Numbers

Numbers in JSON must be an integer or a floating point.

					 
        
          {"age":30}
        
      
JSON Objects

Values in JSON can be objects. Objects as values in JSON must follow the JSON syntax.

					 
        
          {
          "employee":{"name":"John", "age":30, "city":"New York"}
          }
        
      
JSON Arrays

Values in JSON can be arrays.

					 
        
          {
          "employees":["John", "Anna", "Peter"]
          }
        
      
JSON Booleans

Values in JSON can be true/false.

					 
        
          {"sale":true}
        
      
JSON Null

Values in JSON can be null.

					 
        
          {"middlename":null}
        
      

How you feel about this blog:

Share this blog on:

Report Us

If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com

Contact Us
Ads
Logo
Lynxsia IT Solutions

We are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..

Kotwali Road, Chhiptehri, Banda, 210001, UP, India

Copyright © 2022, Lynxsia IT Solutions, All rights reserved