Relative indexing method

Specification
Proposal repo

Modules

es.array.at, es.string.at-alternative and es.typed-array.at.

Built-ins signatures

class Array {
  at(index: int): any;
}

class String {
  at(index: int): string | void;
}

class %TypedArray% {
  at(index: int): number | void;
}

Entry points

core-js/proposals/relative-indexing-method
core-js(-pure)/es|stable|actual|full/array(/virtual)/at
core-js(-pure)/es|stable|actual/string(/virtual)/at
core-js/es|stable|actual|full/typed-array/at

Examples

[1, 2, 3].at(1);  // => 2
[1, 2, 3].at(-1); // => 3

new Int32Array([1, 2, 3]).at(1);  // => 2
new Int32Array([1, 2, 3]).at(-1); // => 3

'abc'.at(1);  // => 'b'
'abc'.at(-1); // => 'c'