Nannying (was: Array comprehension syntax)
Rick Waldron
waldron.rick at gmail.com
Mon Sep 24 12:43:38 PDT 2012
On Mon, Sep 24, 2012 at 3:24 PM, Erik Arvidsson <erik.arvidsson at gmail.com>wrote:
> On Mon, Sep 24, 2012 at 3:20 PM, Rick Waldron <waldron.rick at gmail.com>
> wrote:
> >
> >
> > On Mon, Sep 24, 2012 at 1:37 PM, Jason Orendorff <
> jason.orendorff at gmail.com>
> > wrote:
> >>
> >> snip
> >>
> >>
> >> Here's another program I think we should reject, for the same reason:
> >>
> >> var titles = books.map(b => {title: b.title});
> >
> >
> > Per the proposal, this is already illegal, otherwise requiring parens
> around
> > the object literal. The example given in the proposal is:
>
> It is a valid block that starts with a label :'(
>
It sure is! Poor choice of words using "illegal", what I meant to say was
that it wouldn't return an object literal as the user might expect, unless
it has the parens.
Rick
> > // Parenthesize the body to return an object literal expression
> > let key_maker = val => ({key: val});
> >
> >
> >
> > Rick
> >
> >>
> >> snip
> >
> >
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss at mozilla.org
> > https://mail.mozilla.org/listinfo/es-discuss
> >
>
>
>
> --
> erik
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120924/0ad482c1/attachment.html>
More information about the es-discuss
mailing list