On 12 June 2012 16:42, Herby Vojčík <[email protected]> wrote:
>
>> But I understand there are problems. First, what with optional params
> after ...rest. And the second, how to parse it when foo(1, 2) called?
>
>
I would think with
function foo(a, b, ...others, c) {
}
then given
foo(1, 2);
...within foo a is 1, b is 2, others is empty, and c is undefined. E.g.,
args prior to the restargs get priority over args after rest args. This is
consistent with
foo(1);
...where within foo a is 1, b is undefined, others is empty, and c is
undefined.
It does seem as though it can be deterministic, and pretty easy to explain.
Which isn't necessarily an endorsement, just identifying that this
particular issue doesn't immediately seem like a roadblock.
-- T.J.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss