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

121
Views
Cómo ordenar una matriz de objetos en función de dos propiedades del objeto

Tengo una variedad de objetos como este, por ejemplo.

 names = [{firstName: "Rachel", lastName: "Green"}, {firstName: "Monica", lastName: "Geller"}, {firstName: "Ross", lastName: "Geller"}, {firstName: "Phoebe", lastName: "Buffay"}]

Quiero ordenar la matriz firstName y si el firstName es el mismo, ordene el grupo de objetos con el mismo firstName por lastName . Al igual que se hace en MYSQL mientras le damos ORDER BY a la palabra clave en la consulta, pero quiero hacerlo en javascript de manera óptima, ¿alguna sugerencia?

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!