destructuring: as patterns?

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

On Wed, Apr 18, 2012 at 11:26 AM, Brendan Eich <brendan at> 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

>  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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list