Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
How to get values on the third object of a Json with Javascript

I am doing a get request on JS and with the json reponse i want to get some values, for example product and color, but i don't know how i can go more deeper on the next levels of the objects of the Json.

the Json:

{    
"items": {        
    "1man": {
        "312favorites": {
            "155description": {
                "color": "red",
                "price": 2.76666
            }
          }
        }
    }

}

I just can go until the 1man level i don't know how to get the next levels, my code until now

console.log(response.data.items['1man']);

If i try for example console.log(response.data.items['1man'].312favorites i get error on VScode, i want go to until the color value...

Does someone can help me here?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have to do it this way:

response.data.items['1man']['312favorites']['155description'].color

The reason is that the key has some numbers, and it can't be accessed with Dot notation because it has to be without any numbers or special characters that's why you must use Bracket notation .

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!