Not sure if you are talking about Array.prototype or Symbols but whatever
worry you have is identical. Having a Symbol in the prototype or adding a
method ... I don't see much difference. Which one is best? History shows
it's the method. It plays well, it's easy to polyfill, no complexity added
... is just an Array.prototype.method.

We can survive witohut the .at or .nth like we've done long time, but if a
library would add such prototype I won't blame it. Prototype and others
made most of ES5, after all, and I think for good, common, useful, use
cases.

I'm also off this conversation since I don't have any strong need for such
method.

Regards


On Mon, Jan 25, 2016 at 9:57 PM, Waldemar Horwat <[email protected]>
wrote:

> On 01/25/2016 12:00, Andrea Giammarchi wrote:
>
>> `Array.prototype.nth(n=0)` looks great indeed, +1 here
>>
>> About the Symbol ... ugly as hell also we need to write even more and it
>> doesn't scale as utility compared to .nth
>>
>> ```js
>> a[Symbol.last]
>> a[a.length-1]
>> ```
>>
>
> I fail to see the point of this, other than trying to increase the
> complexity of the language by adding even more cases which do the same
> things but work somewhat differently from existing cases.
>
> We'd have done a lot of things differently if we were starting from
> scratch.  But arrays have a large amount of legacy behavior we can't
> realistically change and, given that, this doesn't improve things much.
>
>     Waldemar
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to