The at() method takes an integer value and allows positive and negative integers.
Useful for getting the n-th value from the front of the array, the nth value from the end of an array.
const arr = ['banana', 'orange', 'apple', 'cherry', 'kiwi']
console.log(arr.at(0))
// "banana"
console.log(arr.at(1))
// "orange"
console.log(arr.at(2))
// "apple"
console.log(arr.at(-1))
// "kiwi"
console.log(arr.at(-2))
// "cherry"
console.log(arr.at(-3))
// "apple"
console.log(arr.at(null))
console.log(arr.at('a'))
console.log(arr.at('b'))
console.log(arr.at([]))
console.log(arr.at({}))
console.log(arr.at(undefined))
// "banana"
console.log(arr.at(true))
// "orange"
console.log(arr.at(false))
// "banana"
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at
https://codepen.io/masanos/pen/YzvRgNK?editors=0012