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

307
Vistas
fetch inner json object using javascript / node js

I am new to node and I am trying to fetch name from the obj but the problem is

How to fetch data from inner json object as my json object look like this

let obj= 
{
  "h4354desdfqw":{
   name:"Computer",
   os:"Window",
  },
  "hjsado24334":{
   name:"Software",
   type:"Adobe",
  },
  "qwsak032142":{
   name:"hardware",
   type:"hardisk",
  },
}

console.log(obj.h4354desdfqw.name)

I am trying to fetch all the name which are present inside the json object like this

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

0

I am not sure in which representation you would like get the data. I can assume - you would like to get array of the names

let obj= 
{
  "h4354desdfqw":{
   name:"Computer",
   os:"Window",
  },
  "hjsado24334":{
   name:"Software",
   type:"Adobe",
  },
  "qwsak032142":{
   name:"hardware",
   type:"hardisk",
  },
}

const result = Object.values(obj).map(i => i.name);

console.log(result)

Object.values(obj).map(i => console.log(i.name));

about 4 years ago · Juan Pablo Isaza Denunciar

0

You want to get the value of name for each object. So let's iterate through each object's name with the map function :

const result = Object.values(obj).map(i => i.name);
console.log(result);
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