Array.at Negative Indices
const arr = [
'one', 'two',
'three', 'four'
];
console.log(
arr.at(-1),
arr.at(-2),
arr.at(0)
);
Array.at
allows negative index values to be used to read elements from an array. I’ve seen this done using a Proxy in the past.