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

111
Vistas
convert object of object to array of objects and iterate the text

I have JSON Objects, I want to convert it to array and iterate to each of text

Here is JSON Object:

"dataObject":{
  "object2":{
    "id":"123456",
    "userId":"76890",
    "name":"home"
    }
   }

Here is the view.jsx

<div>
<p>id:{id}</p>
<p>userId:{userId}</p>
<p>name:{name}</p>
</div>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could use Object.values to grab the values of your dataObject and map through those values

function App() {
  const dataObject = {
    object1: {
      id: "3123456",
      userId: "476890",
      name: "1home"
    },
    object2: {
      id: "123456",
      userId: "76890",
      name: "home"
    }
  };

  return (
    <div>
      {Object.values(dataObject).map(({ id, userId, name }) => (
        <div>
          <p>id:{id}</p>
          <p>userId:{userId}</p>
          <p>name:{name}</p>
        </div>
      ))}
    </div>
  );
}

Demo:

Edit dry-night-uwwmk1

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