Apologies if something like this has already been proposed.
We have simplified object literal syntax:
{a, b}
However, I often find myself writing this:
{a: x.a, b: y.b}
Would it be possible to have a syntax such as
{x.a, y.b}
Where the property name is taken from the last segment of the property
reference, so that `x.a` becomes the value of property `a`?
--
Bob
On Wed, Mar 11, 2015 at 9:26 PM, Allen Wirfs-Brock <[email protected]>
wrote:
>
> On Mar 11, 2015, at 7:23 AM, Bergi wrote:
>
> Bob Myers schrieb:
>
> Apologies if something like this has already been proposed and/or rejected
>
> for whatever reason.
>
>
> I think you're looking for the same as
> http://wiki.ecmascript.org/doku.php?id=strawman:define_properties_operator
>
>
> also see: https://github.com/allenwb/ESideas/blob/master/dcltomethod.md
>
> Allen
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss