Wildcard

Axel Rauschmayer axel at rauschma.de
Sun Dec 30 04:06:58 PST 2012


It wouldn’t be breaking if it was the only identifier that one was allowed to use multiple time, right?

But I do like the idea of the dot. Would be nice for destructuring arrays, too:

let [., ., third] = myArray;

On Dec 30, 2012, at 13:01 , Andreas Rossberg <rossberg at google.com> wrote:

> On 30 December 2012 12:50, Axel Rauschmayer <axel at rauschma.de> wrote:
>> It would actually be nice to have that as a feature: If the variable name is
>> `_` then it can be used multiple times. It’s a nice, self-descriptive way of
>> saying that you don’t care about a parameter value.
> 
> That underscore wildcard is the exact syntax used in functional
> languages, and very useful, I agree. In JS, that syntax would be a
> breaking change, unfortunately. But we could use something else (e.g.
> I proposed '.' in the past).
> 
> /Andreas
> 

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121230/9b99ea5c/attachment-0001.html>


More information about the es-discuss mailing list