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

115
Vistas
Convert an array of Object's specific key Values to Comma-Separated String

How do we Convert an Object's specific key Values to Comma-Separated String , I can convert when it is an array but my issue is that my data is an array of objects , so I wanna convert every id to an array of strings like an example below.

#current code - just initial idea

console.log(['a', 'b', 'c'].join(','));

#example object

data = [
    {
        "id": 496,
    },
    {
        "id": 381,
    }
]

#expected result

  '496,381'
almost 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can simply map the items of your array of objects, to extract the value of their id key:

The map() method creates a new array populated with the results of calling a provided function on every element in the calling array.

data.map(item => item.id).join()
almost 4 years ago · Santiago Trujillo 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