Jason Orendorff wrote:
On Sun, Jan 6, 2013 at 6:31 PM, Axel Rauschmayer <[email protected]
<mailto:[email protected]>> wrote:
What is the simplest way of enforcing an arity in ES6? Doesn’t it
involve arguments?
Hmm. Can you do this?
function f(x, y, ...[]) {}
The question is, with refutable-by-default, does the empty array pattern
fail on any non-empty arraylike match target? If yes, then we need a way
to match prefixes of arraylikes (including empty prefixes!):
let [] = must_be_empty();
let [...many] = however_many();
let [first?, second?] = two();
I buy it!
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss