ECMAScript proposal: Method <code>.item()</code> for Arrays, Typed Arrays, and strings

1 · Axel Rauschmayer · Sept. 23, 2020, 7:23 a.m.
Summary
The ECMAScript proposal “.item()” (by Shu-yu Guo and Tab Atkins) introduces the mentioned method for indexable values (Arrays, Typed Arrays, strings). Given an index, the method returns the corresponding element. Its key benefit is that indices can be negative (-1 gets the last element, -2 the second last, etc.). This blog post examines .item() in detail. [Read rest of post]...