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

266
Vistas
Is it possible to "reverse spread" with Object.assign()?

I know "reverse spread" might not be the proper description for it but I couldn't think of anything else.

I'm trying to remove a set of keys like a and b, from an object and store the rest in rest.

const { a, b, ...rest } = bunchOfKeysAndValues;

But I can't use spread operator.

Is it possible to achieve this with Object.assign() or in some other way?

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

0

Use Object.assign() to make a copy of the object, extract a and b from it, then remove them.

const rest = Object.assign({}, bunchOfKeysAndValues);
const {a, b} = rest;
delete rest.a;
delete rest.b;
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