Open Deco opened 7 years ago
But _
as an special name to indicate unused var is just a workaround. I think we may reuse some keywords/symbols here.
var {x: void, ...rest} = obj
Or
var {x: delete, ...rest} = obj
Or
var {x!, ...rest} = obj
It would be really nice if there were a way to remove properties when using a rest property without creating a binding.
Has there been any discussion about removing/filtering keys during spread?
For example:
At the moment,
z
is currently achievable using this multi-statement code:or using this single-expression but rather verbose and potentially-less-optimizable code:
It'd be nice if it could be done in an object spread expression, perhaps using my proposed syntax.