Yes it seems like a natural combination of the destructuring and object shorthand features (the `=` version that is). Can anybody name the pitfalls or point to where they have been mentioned (if any have been)?
On Sun, 18 Mar 2018 at 08:52 Michael Theriot <[email protected]> wrote: > 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 >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

