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

127
Views
atravesar la estructura del objeto json contiene matrices

Así que tengo la siguiente estructura... ¿Cómo puedo iterar sobre la estructura de "valores" para extraer todas las matrices posibles de "paramX"... puedo usar un bucle?

Estoy obteniendo esta estructura de una llamada a un servicio externo desde una llamada de javascript ... Entonces, en 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

Aquí uso Object.keys() para devolver una matriz de claves en valores y luego hago un bucle forEach en esa matriz:

 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!