Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 944763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:38:47+00:00 2026-05-15T22:38:47+00:00

I am new to json. I have json output that looks like this [

  • 0

I am new to json. I have json output that looks like this

[
    {
        "employees": {
            "education": "BE\/B.Tech"
        },
        "0": {
            "count": "1"
        }
    },
    {
        "employees": {
            "education": "MBA"
        },
        "0": {
            "count": "3"
        }
    }
]

I want to retrieve the employee’s education and the count. I have tried but i am not able to retrieve the values.

I appreciate any help.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:38:48+00:00Added an answer on May 15, 2026 at 10:38 pm

    Assuming your JSON string is in a variable $json, it goes like this:

    var employees_list = JSON.parse($json);
    

    Then you can access the information via:

    employees_list[0].employees.education // gives you "BE\/B.Tech"
    // and
    employees_list[0]["0"].count // gives you 1.
    

    You can also loop over the array and access all the different education this way.

    Update:

    To better demonstrate which expression accesses which information:

    [                                      // employees_list
        {                                  // employees_list[0]
            "employees": {                 // employees_list[0].employees
                "education": "BE\/B.Tech"  // employees_list[0].employees.education
            },
            "0": {                         // employees_list[0]["0"]
                "count": "1"               // employees_list[0]["0"].count
            }
        }, 
        {                                  // employees_list[1]
            "employees": {                 // employees_list[1].employees
                "education": "MBA"         // employees_list[1].employees.education
            },
            "0": {                         // employees_list[1]["0"]
                "count": "3"               // employees_list[1]["0"].count
            }
        }
    ]
    

    Generally employees_list[0].employees is the same as employees_list[0]["employees"] but this does not work for numbers, because properties and variables are not allowed to start with numbers. So you can only use employees_list[0].["0"] and not employees_list[0].0.


    The structure of your JSON string looks a bit strange though. You should consider to structure it differently if you can.

    For example:

    [
        {
            "education": "BE\/B.Tech",
            "count": "1"
        },
        {
            "education": "MBA"
            "count": "3"
        }
    ]
    

    The "0" key in your original JSON string seems to serve no purpose and just complicates the access.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this JSON: var projects_array = new Array( {name:myName1, id:myid1, index:1}, {name:myName2, id:myid2,
I am very new to Python and I have a json news feed that
I have this code: $coder = JSON::XS->new->utf8->pretty->allow_nonref; %perl = $coder->decode ($json); When I write
i have an asp.net controller that output Json as the results a section of
I'm new to JSON and APIs (everything like that). I am trying to test
am new to Json so a little green. I have a Rest Based Service
I have a problem accessing JSON data. I'm new to JSON and jquery so
I am pretty new to YUI and need some help. I have a JSON
I have: localStorage.xxx = JSON.stringify([[something,hello],[something2,hello2]]); . How can i add a new array in
I'm new to jquery and JSON. I have the following JSON structure. { address:{

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.