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

125
Vistas
Extracting a data from json array by certain key in java script

I have a json array which im getting my react data from it, the json is like this:

 {
         "Folders": [
           {
             "name": "parent 2",
             "children": [        //this is children_1
                {
                  "name": "parent 2",
                  "id": "parent 2",
                  "children": []     //this is children_2
                 }
               ],
               "id": 1
            }
          ]
        }

lets say i have the key value of name inside children(children_1) and i want to get the rest of the data inside that children using the name that i have, is there a way to do that ?

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

0

Look at jsonpath

so it will be

var json = require('jsonpath');
var names = jp.query(json, '$.Folders[*].children[*].children');

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