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

239
Vistas
Remove subarray of array and convert into objects?

I have an array of arrays which I have to convert into an array of objects:

[
  [
    {
      lable: "text",
      anotherValue: "anothervalue"
    }
  ], 
  [
    {
      lable: "text",
      anotherValue: "anothervalue"
    }
  ]
]

I need to convert this into:

[
  {
    lable: "text",
    anotherValue: "another value"
  }, 
  {
    lable: "text",
    anotherValue: "another value"
  }
]
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can do that using map. The function given to map as a parameter unpacks each subarray and replaces it by the object within.

a = [
  [{lable:'text',anotherValue:'anothervalue'}], 
  [{lable:'text',anotherValue:'anothervalue'}]
];

result = a.map((o) => o[0])
about 4 years ago · Juan Pablo Isaza Denunciar
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