Not up to speed with any pitfalls already discussed but for what it's worth I 
tried this at least a few times when destructuring landed and was disappointed 
it didn't work.

> On Mar 16, 2018, at 4:30 PM, Sebastian Malton <[email protected]> wrote:
> 
> Hello currently the following is a possible way to define an object. 
> 
> ```
> var d = { a, b, c };
> ```
> 
> But this only works if the fields are already variables.
> 
> So if you wanted to select some fields from an object within you have to use 
> temp variables, reference the field by name but without the temporary 
> variables, or use some immediately called functions which is messy.
> 
> So I propose the following syntax:
> 
> ```
> var d = {
>     a,
>     b,
>     { c }: e
> };
> ```
> 
> Here d will have the fields [a, b, c] and the values are the variable a, 
> variable b, and value e.c.
> 
> Other things like name reassignment would work too.
> 
> Sebastian Malton
> 
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to