destructuring: as patterns?

David Nolen dnolen.lists at gmail.com
Wed Apr 18 08:41:14 PDT 2012


On Wed, Apr 18, 2012 at 11:26 AM, Brendan Eich <brendan at mozilla.org> wrote:

> We've supported destructuring for years and no one has asked for this. I
> say YAGNI and when in doubt, leave it out. One can always write two
> destructuring declarations without much repetition:
>

But who has been using it? Certainly not the general JS development
community.


>  let {b} = obj;
>  let {x,y} = b;
>
> but of course one would just write
>
>  let {x, y} = obj.b;
>
> in that contrived case.
>
> Main thing is, not having as-patterns is not a big deal based on
> experience with JS1.7+ since 2006 in Mozilla code.
>
> /be


I've found it quite useful in Clojure/Script and I'm sure folks who have
encountered the feature in the ML derived languages would agree.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120418/629cbfc3/attachment.html>


More information about the es-discuss mailing list