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

242
Vistas
How to extract data from a big and deep down object in javascript

I have a very deep-down object from which I need to extract a specific object from it. but I don't quite know it.

This is a pic of object. enter image description here

As you see in the picture, I need to extract the slider and slides together.

Is there anyone who may be able to help a bit or just write down how to do it I will write the code out?

nst slide = `[{"data":{"pageLayouts":{"data":[{"attributes":{"title":"Home","subtitle":"Our project","slider":{"title":"She was undergoing treatment at Saifee Hospital in Mumbai for the past 15 day","slides":[{"id":"1","image":{"data":[{"id":"4","__typename":"UploadFileEntity"}],"__typename":"UploadFileRelationResponseCollection"},"title":"Prime Minister Narendra Modi","subtitle":"Prime Minis a Modi","__typename":"ComponentSlidesComSlides"},{"id":"3","image":{"data":[{"id":"5","__typename":"UploadFileEntity"}],"__typename":"UploadFileRelationResponseCollection"},"title":"Another slider","subtitle":"sub title for another slider","__typename":"ComponentSlidesComSlides"},{"id":"2","image":{"data":[{"id":"4","__typename":"UploadFileEntity"}],"__typename":"UploadFileRelationResponseCollection"},"title":"some more slider","subtitle":"sub title fore some more slider","__typename":"ComponentSlidesComSlides"}],"__typename":"ComponentSliderComSlider"},"__typename":"PageLayout"},"__typename":"PageLayoutEntity"}],"__typename":"PageLayoutEntityResponseCollection"}},"loading":false,"networkStatus":7,"stale":false}]`

Thank you so much.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

var slider = obj[0].data.pageLayouts.data[0].attributes.slider

var obj = [{
  "data": {
    "pageLayouts": {
      "data": [{
        "attributes": {
          "title": "Home",
          "subtitle": "Our project",
          "slider": {
            "title": "She was undergoing treatment at Saifee Hospital in Mumbai for the past 15 day",
            "slides": [{
              "id": "1",
              "image": {
                "data": [{
                  "id": "4",
                  "__typename": "UploadFileEntity"
                }],
                "__typename": "UploadFileRelationResponseCollection"
              },
              "title": "Prime Minister Narendra Modi",
              "subtitle": "Prime Minis a Modi",
              "__typename": "ComponentSlidesComSlides"
            }, {
              "id": "3",
              "image": {
                "data": [{
                  "id": "5",
                  "__typename": "UploadFileEntity"
                }],
                "__typename": "UploadFileRelationResponseCollection"
              },
              "title": "Another slider",
              "subtitle": "sub title for another slider",
              "__typename": "ComponentSlidesComSlides"
            }, {
              "id": "2",
              "image": {
                "data": [{
                  "id": "4",
                  "__typename": "UploadFileEntity"
                }],
                "__typename": "UploadFileRelationResponseCollection"
              },
              "title": "some more slider",
              "subtitle": "sub title fore some more slider",
              "__typename": "ComponentSlidesComSlides"
            }],
            "__typename": "ComponentSliderComSlider"
          },
          "__typename": "PageLayout"
        },
        "__typename": "PageLayoutEntity"
      }],
      "__typename": "PageLayoutEntityResponseCollection"
    }
  },
  "loading": false,
  "networkStatus": 7,
  "stale": false
}]

var slider = obj[0].data.pageLayouts.data[0].attributes.slider
console.log(slider)

about 4 years ago · Juan Pablo Isaza Denunciar

0

First covert JSON to JavaScript object and use object déstructuré syntax

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