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

275
Vistas
JS: merge array of objects when different key

I'm looking for a smart way to merge array of objects when they have different keys. "Smart" here I mean, you can use for loop for example to push or concat objects to create the desired object, but here I'm looking for a shorter way (like using map or such) if possible.

The below is an example of the array of objects where each object have different key.

[
    {
        privacy: true
    }, 
    {
        date: true
    }
]

From the above, the desired result would be like this below.

{
    privacy: true,
    date: true
}

So what can I implement smartly (but not for loop or a redundant way) to do this? Thanks for your help.

about 4 years ago · Santiago Trujillo
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