JavaScript Language feature Idea

Axel Rauschmayer rauschma at icloud.com
Sat Apr 16 20:04:00 UTC 2016


Another possibility is `Array.prototype.get()`, which would be in line with ES6 Maps.

> On 02 Feb 2016, at 21:15, Jonas Sicking <jonas at sicking.cc> wrote:
> 
> On Mon, Jan 25, 2016 at 12:38 PM, Andrea Giammarchi
> <andrea.giammarchi at gmail.com> wrote:
>> FWIW `.at` works for me. Anything really, as long as `Symbol.last` won't
>> even be proposed :D
> 
> If we name it `.item` that would mean that a whole bunch of DOM
> classes could be replaced with plain JS Arrays.
> 
> For example FileList, MessagePortList, DOMRectList, TouchList, etc.
> 
> It would also mean API compatibility with a whole lot of more APIs,
> like NodeList, DOMTokenList and CSSValueList. While we couldn't
> replace these with actual Arrays (for varying reasons), we'd end up
> with classes that have more API surface in common.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



More information about the es-discuss mailing list