Hey folks,
 
I've figured out a potential improvement for the object spread syntax and want to share my thoughts.
I've drafted my thoughts into a proposal available here: https://github.com/devlato/proposal-plus-minus-spread
 
Long story short, I want to propose a new **minus operator**, that would allow specify keys to remove the values from a result of object spread. It would look like this:
 
const result = {
  ...objA,
  ...objB,
  -keyToRemove,
};

// Or like this – the same result!
const result = {
  ...objA,
  -keyToRemove,
  ...objB,
};

// And this!
const result = {
  -keyToRemove,
  ...objA,
  ...objB,
};
 
What do you folks think?
 
Warmest regards,
Denis
 
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to