An array destructing specification choice

Allen Wirfs-Brock allen at
Sat Nov 5 11:16:45 PDT 2011

On Nov 5, 2011, at 11:01 AM, John J Barton wrote:
> I can see why my version is wrong: I am interpreting square brackets
> on the RHS like JS devs would.
>  let z = _rhs[0]; // LHS was array, so get zeroth elt,but RHS is
> object so property access.
> But the feature does not do this. Rather, since LHS is array, it
> coerces the RHS to an array:
>  let z = coerceToArray(_rhs)[0];
> and we don't know what that operation means.

What do you think this returns:{0:0, 1:1, length: 2, 2:2})


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

More information about the es-discuss mailing list