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

190
Views
¿Cómo agrupo varios registros en una matriz para objetar en Javascript?

¡Espero que todos estén bien!

¿Hay alguien aquí que pueda ayudar a agrupar la siguiente matriz para ordenar objetos por el segundo elemento de cada registro en Javascript?

es decir: "{first},{second},{third},{fourth}" -> "bob,627,1973,Amsterdam"

Tomemos por ejemplo esta matriz:

 [ 'bob,627,1973,amsterdam', 'alice,387,885,bangkok', 'alice,355,1029,barcelona', 'alice,587,402,bangkok', 'charlie,973,830,barcelona', 'alice,932,86,bangkok', 'bob,188,989,amsterdam' ];

Resultado Esperado:

 { alex: [ [ 355, '1029', 'barcelona' ], [ 387, '885', 'bangkok' ], [ 587, '402', 'bangkok' ], [ 932, '86', 'bangkok' ], ], bob: [ [ 188, '989', 'amsterdam' ], [ 627, '1973', 'amsterdam' ], ], charlie: [ [ 973, '830', 'barcelona' ], ], }
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!