<div>Hey folks,</div><div> </div><div>I've figured out a potential improvement for the object spread syntax and want to share my thoughts.</div><div>I've drafted my thoughts into a proposal available here: <a href="https://github.com/devlato/proposal-plus-minus-spread/blob/master/README.md">https://github.com/devlato/proposal-plus-minus-spread</a></div><div> </div><div>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:</div><div> </div><div><pre style="background-color:rgb( 246 , 248 , 250 );border-radius:3px;box-sizing:border-box;color:rgb( 36 , 41 , 46 );font-family:'sfmono-regular' , 'consolas' , 'liberation mono' , 'menlo' , monospace;font-size:13.6px;font-style:normal;font-weight:400;line-height:1.45;margin-bottom:0px;margin-top:0px;overflow:auto;padding:16px;text-decoration-style:initial;text-indent:0px;text-transform:none;word-break:normal;word-spacing:0px"><span style="box-sizing:border-box;color:#d73a49">const</span> <span style="box-sizing:border-box">result</span> <span style="box-sizing:border-box;color:#005cc5">=</span> <span style="box-sizing:border-box">{<!-- --></span>
  ...<span style="box-sizing:border-box">objA,</span>
  ...<span style="box-sizing:border-box">objB,</span>
  <span style="box-sizing:border-box;color:#005cc5">-</span>keyToRemove<span style="box-sizing:border-box">,</span>
<span style="box-sizing:border-box">};</span>

<span style="box-sizing:border-box;color:#6a737d">// Or like this – the same result!</span>
<span style="box-sizing:border-box;color:#d73a49">const</span> <span style="box-sizing:border-box">result</span> <span style="box-sizing:border-box;color:#005cc5">=</span> <span style="box-sizing:border-box">{<!-- --></span>
  ...<span style="box-sizing:border-box">objA,</span>
  <span style="box-sizing:border-box;color:#005cc5">-</span>keyToRemove<span style="box-sizing:border-box">,</span>
  ...<span style="box-sizing:border-box">objB,</span>
<span style="box-sizing:border-box">};</span>

<span style="box-sizing:border-box;color:#6a737d">// And this!</span>
<span style="box-sizing:border-box;color:#d73a49">const</span> <span style="box-sizing:border-box">result</span> <span style="box-sizing:border-box;color:#005cc5">=</span> <span style="box-sizing:border-box">{<!-- --></span>
  <span style="box-sizing:border-box;color:#005cc5">-</span>keyToRemove<span style="box-sizing:border-box">,</span>
  ...<span style="box-sizing:border-box">objA,</span>
  ...<span style="box-sizing:border-box">objB,</span>
<span style="box-sizing:border-box">};</span></pre></div><div> </div><div>What do you folks think?</div><div> </div><div>Warmest regards,</div><div>Denis</div><div> </div>