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?
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;