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

173
Views
How to sort an Array of objects in Javascript

I have this array:

array: [
    {id: 1, title: 'Thanos', content: '123'},
    {id: 2, title: 'Deadpool', content: '456'},
    {id: 3, title: 'Batman', content: '789'}
]

and I want it to be sorted by title key. How do I do that in Javascript?

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

0

array.sort((a, b) => a.title.localeCompare(b.title));
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!