>> var lastItem =
>> myObject.anArray[ myObject.anArray.length - 1 ];
>> myObject.anArray[ myObject.anArray.length - 2 ] = "foo";
>
> a = myObject.anArray; a[a.length - 1];
> a[a.length - 2] = "foo";

What is the problem allowing following instead of above?
   a = myObject.anArray; a[-1];
   a[-2] = "foo";

And I see, I can reduce a lot of my code if I can do
   a[ - a_var_with_postive_value] = "foo";

> It would be incompatible, since a[-1] means the same thing for arrays
> as for objects: the property named "-1".

And I dont think any body depending on such code now,
ie expecting "-1" as property name in Array
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to