Proposal: syntactic sugar for extracting fields from objects

Bob Myers rtm at gol.com
Fri May 31 16:09:58 UTC 2019


On Fri, May 31, 2019 at 2:08 AM Cyril Auburtin <cyril.auburtin at gmail.com>
wrote:

> After thinking about it, the dot-notation is maybe confusing, because
>
> ```js
> obj.{a}
> ```
> looks like
> ```js
> obj.a
> ```
> But the results are totally different
>

They are intended to look alike.
The results are not "totally different"--in both cases, one or more
properties in the object to the left of the dot are being referenced.
That's what the dot means.

Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190531/86f4bb3b/attachment.html>


More information about the es-discuss mailing list