An array destructing specification choice
Till Schneidereit
tschneidereit at gmail.com
Mon Nov 7 03:50:27 PST 2011
> I.e., I think the most easily comprehensible behavior is to make array
> destructuring treat the RHS as an Array.
> It matches the common use-case (actual arrays), it is consistent (does
> the same whether you use ... or not), and is easily explainable.
I agree with the consistency argument. The reason I'm in favor of [no,
no] is that otherwise
[x,y,z] = {0:0, 1:1, 2:2}
would result in
x=undefined,y=undefined,z=undefined
That doesn't seem desirable to me.
More information about the es-discuss
mailing list