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

161
Vistas
Get the values from object wrapped in another object based on the key?

I am trying to find the Javascript values of an object wrapped in another object based on the Object Key using the ES6 way or single-line approach without using the loop.

I have the data object something like this:

data = {
   "1":{
      "id":1,
      "name":"Identifiers",
      "data":{
         "ID":1,
         "nodeId":1,
         "eventType":"Identifiers"
      },
      "2":{
         "id":2,
         "name":"Events",
         "data":{
            "ID":2,
            "nodeId":1,
            "eventType":"ObjectEvent"
         }
      }
   }
}

and I have a connector something like this:

{
   "ID":1,
   "name":"connector1",
   "source":"1",
   "target":"2"
}

I want to find the information from data based on the connector.source

I want to pass the connector.source and get the corresponding values from it, something like this:

"id":1,
"name":"Identifiers",
"data":{
        "ID":1,
         "nodeId":1,
         "eventType":"Identifiers"
      }

I am aware that I can use the for loop and do that but I am trying to find a ES6 way or using the single line code.

about 4 years ago · Juan Pablo Isaza
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