Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda