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

150
Views
¿Cómo reorganizar la matriz con este formato en JS?

Tengo una matriz de objetos de valores clave en este formato y necesito transformarla. En cada periodo tengo dos (o más) estados (vacío o lleno, aunque puede haber más). Cada uno de estos estados tiene un cierto número de observaciones (recuento).

 //original format const test = [ { "count":[8,31,3], "period":["2021-12","2022-01","2022-01"], "status":["empty","empty","full"] } ] //transformation I need output = [ { period:"2021-12", status:"empty", count:8 }, { period:"2022-01", status:"empty", count:31 }, { period:"2022-01", status:"full", count:3 } ]

¿Cómo reorganizar el formato de esta matriz en JS? He intentado usar una función de reducción pero no he podido entenderlo.

about 4 years ago · Juan Pablo Isaza
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!