JSON and brackets

Posted on 2014-07-14
Last Modified: 2014-07-14
There is a web service that returns the following:


What is the difference between this JSON structure, and the following one:


Open in new window

without the hard brackets.

What do the hard brackets represent?
Question by:Anthony Lucia
    LVL 21

    Assisted Solution

    by:Randy Poole
    The square brackets specify an array.  where the { brackets specify an object.  So in the first response you could get back more then 1 object
    LVL 81

    Assisted Solution

    var json = [{"1":444}];
    var j1 = json[0];
    alert( j1[1] ); // alert 444

    Open in new window

    VS :
    var j1 = {"1":444};
    alert( j1[1] ); // alert 444

    Open in new window

    LVL 74

    Accepted Solution

    The JSON specification is a good place to go to understand all of the syntax you might encounter.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now