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

114
Vistas
Removing Object from Array of Array in Javascript

Hey Guys I am exporting some data.
And the challenge I am facing is the data should be in Array of Objects but don't know the data format is Array in Array of Objects.
I can write a script to transform the data to the desired format.
Can anyone help me out with how can I remove the object from the inner array to the outer array?
The data is in this format.

{
  "data": [
    [
      {
        "id": "4101"
      }
    ]
  ]
}

My Resultant Format looks like this Can anyone help me write a javascript to accomplish this objective

{
  "data": [
      {
        "id": "4104",
      }
  ]
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Please give a try to this :

var a=obj.data.splice(0, 1);
obj.data.push(a[0]);

or in one line if you want :

obj.data.push(obj.data.splice(0, 1)[0]);

Provided you cannot correct the input at the source.

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