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

165
Views
Javascript sort string with numbers at the end of dupliacte strings

I am trying to sort an array by "itemCommodity". I need to sort my array by the smallest number at the start of the string and the highest number at the end. For example:

["Untitled Form - 16", "Untitled Form - 1", "Untitled Form - 7", "Untitled Form - 2", "Untitled Form - 3", "Untitled Form - 4", "Untitled Form - 5", "Untitled Form - 8", "Untitled Form"];

Should be displayed as:

["Untitled Form", "Untitled Form - 1", "Untitled Form - 2", "Untitled Form - 3", "Untitled Form - 4", "Untitled Form - 5", "Untitled Form - 7", "Untitled Form - 8", "Untitled Form - 16"];

I hope someone can help me out with this.

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!