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

123
Views
traversing json object structure contains arrays

So i have the following structure.. How can iterate over "values" structure to extract all the possible "paramX" arrays... can i use a loop?

Im getting this structure from a call to external service from a javascript call.. So in java script.

{

  "booleanValue": true,

  "values": {

    "param1": ["1.00", "20.00"],

    "param2": [ "2,000.00", "200.00"],

    "param3": [  [  "Test1",  "CC1", ], [  "T222222",  "CC2212", ]    ]

  }

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

0

Here I use Object.keys() to return an array of keys in values and then do a forEach loop on that array:

var str = `{
  "booleanValue": true,
  "values": {
    "param1": ["1.00", "20.00"],
    "param2": ["2,000.00", "200.00"],
    "param3": [["Test1",  "CC1"],["T222222","CC2212"]]
  }
}`;

var obj = JSON.parse(str);

Object.keys(obj.values).forEach(key => {
  console.log(key, obj.values[key]);
});

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!