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

102
Views
Bucle sobre estructuras de matrices complejas con las mejores prácticas y la menor complejidad

Estoy llamando a una API que devuelve

 [{ Id:string, Value:string, Value2: [{Id:string,Value3:string}] , { Id:string, Value:string, Value2: [{Id:string,Value3:string}] }]

¿Cómo hago un bucle sobre el valor 2 con la complejidad más baja y el mejor enfoque en JS?

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

0

No estoy seguro de entender su problema, pero simplemente puede mapear los elementos de su tabla de esa manera (suponiendo que una variable llamada table contenga sus datos):

 table.map((item) => { console.log(JSON.stringify(item.Value2)) })

Y si desea recorrer los valores de Value2:

 table.map((item) => { item.Value2.map((subitem) => { console.log(subitem.Value3) }) })
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!