On Fri, Mar 16, 2018 at 1:58 PM, Sebastian Malton <[email protected]> wrote:
> Yes that is possible but what if you want to do the following?
>
> ```
> var a = {
>     b: B.b,
>     c: B.c,
>     d: B.d,
>     e: B.e
> };
> ```
>
> Would it not be easier to do the following?
>
> ```
> var a = {
>     { b, c, d, e }: B
> };
> ```

It's shorter to write, sure. But we can come up with special-purpose
ways to shorten code all day.

This proposal is not consistent with the existing shorthand syntax, or
the object-destructuring syntax it also somewhat resembles. It's
unique, while looking very similar to existing syntax, and for a
relatively small case (extracting a subset of the properties of an
object into another object, with the same key names).  That's usually
not a recipe for success. :(

~TJ
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to