JavaScript Language feature Idea

Michał Wadas michalwadas at
Tue Apr 19 14:37:19 UTC 2016

2016-04-19 10:40 GMT+02:00 Jordan Harband <ljharb at>:

> (note that `Set#get(-1)` does not retrieve the last item in the set, for
> example).

Because Set.prototype.get doesn't even exist. And Set by definition is an
unordered collection, so there is no "last" element.

I think Array.prototype.get and Array.prototype.set are the way to go - it
should not break backward compatibility. And it's consistent with
Array.prototype.slice behaviour.

BTW, this was discussed 3 years ago:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list