Important Points to Remember: JSON rules

Table of Contents

JSON rules

  • To access JSON data that is parsed as a JS object into a variable in JavaScript, we use dot/bracket notation as shown below.
    access JSON data
  • To drill down further, we need to chain the required property name with the required index of the array together. This is explained below:
    Access JSON Array
    Note: All codes are written directly into the console of a browser so that, instantly an error can be identified.
  • It is mandatory to use double quotes [single quotes are not valid] around strings and property names in JSON.
  • Even a single comma can cause a JSON file to go wrong. Therefore, it is very important to use a JSON validator, before passing JSON to our code. A JSON validator like, helps us to identify errors within our JSON code.


  • Barry Allen

    A Full Stack Developer with 10+ years of experience in different domain including SAP, Blockchain, AI and Web Development.

    View all posts


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.